#include <gmlib/sm9/internal/sm9_field.h>
#include <stdexcept>
#include <cstring>

using namespace sm9::internal;

void test_sm9_fn_sub()
{
    sm9_fn_t    a, b, c;
    std::uint8_t c_data[32];

    static std::uint8_t a0[32] = {0x83,0xe2,0x12,0x3c,0x7e,0xda,0xf6,0x7e,0xd5,0x0c,0x39,0xee,0xf0,0x38,0xe8,0x7e,0xe0,0x80,0xce,0xe0,0x32,0xc5,0xc9,0xb3,0x63,0x2d,0xbb,0xb8,0xc8,0xd6,0x36,0x2c};
    static std::uint8_t b0[32] = {0x50,0xee,0x78,0x4b,0x6c,0x81,0xc3,0x3b,0xd2,0x0a,0x7c,0x91,0x90,0xd4,0x87,0x08,0x66,0xf4,0xa7,0xa5,0x23,0xb7,0x61,0xc2,0x63,0xc7,0xe3,0xd3,0x2f,0x75,0x98,0xf9};
    static std::uint8_t c0[32] = {0x32,0xf3,0x99,0xf1,0x12,0x59,0x33,0x43,0x03,0x01,0xbd,0x5d,0x5f,0x64,0x61,0x76,0x79,0x8c,0x27,0x3b,0x0f,0x0e,0x67,0xf0,0xff,0x65,0xd7,0xe5,0x99,0x60,0x9d,0x33};
    sm9_fn_from_bytes(a, a0);
    sm9_fn_from_bytes(b, b0);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c0, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a1[32] = {0x39,0xaf,0xc9,0xee,0x8d,0x07,0xcf,0x76,0xe9,0xce,0x25,0x25,0x07,0x50,0xb0,0x48,0x27,0x14,0x97,0xdc,0x6f,0x00,0x5e,0x73,0x33,0x9d,0x90,0xb5,0xad,0x44,0x4a,0xdc};
    static std::uint8_t b1[32] = {0x39,0x5b,0x0c,0xcd,0xbe,0x4e,0xb5,0x2e,0xd0,0x2e,0xf3,0x15,0x55,0x5b,0xc6,0x8e,0x6f,0xdd,0x44,0x57,0xdc,0xb9,0x80,0x53,0xbd,0x2c,0x22,0x26,0x6e,0x47,0xb9,0x92};
    static std::uint8_t c1[32] = {0x00,0x54,0xbd,0x20,0xce,0xb9,0x1a,0x48,0x19,0x9f,0x32,0x0f,0xb1,0xf4,0xe9,0xb9,0xb7,0x37,0x53,0x84,0x92,0x46,0xde,0x1f,0x76,0x71,0x6e,0x8f,0x3e,0xfc,0x91,0x4a};
    sm9_fn_from_bytes(a, a1);
    sm9_fn_from_bytes(b, b1);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c1, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a2[32] = {0x22,0x1c,0x4b,0x55,0x9c,0xb8,0x86,0xc5,0xa5,0x32,0x87,0xc4,0x19,0x9a,0xa3,0x1c,0x4e,0xac,0x1d,0xc0,0x11,0xf9,0x10,0x5a,0x5e,0xca,0x29,0x11,0x32,0x3d,0x6f,0x0e};
    static std::uint8_t b2[32] = {0x8c,0x31,0x5f,0x53,0x93,0x8a,0x8e,0xff,0xbe,0x4b,0x39,0x4c,0x1a,0xc1,0x88,0x82,0x5f,0xf0,0x19,0x7c,0x49,0x5f,0x35,0x94,0x61,0xc0,0xe8,0x5f,0xd5,0x9a,0x50,0x44};
    static std::uint8_t c2[32] = {0x4c,0x2a,0xec,0x02,0x0b,0xd1,0x9e,0xb7,0xbc,0xea,0xf9,0xc7,0xf4,0x67,0xe1,0xde,0x38,0xae,0x97,0x8e,0xe1,0x84,0x66,0xb4,0xe2,0x78,0x22,0x4e,0x33,0x41,0xed,0xef};
    sm9_fn_from_bytes(a, a2);
    sm9_fn_from_bytes(b, b2);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c2, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a3[32] = {0x9a,0x5a,0xa3,0xd9,0x9e,0x0e,0xb2,0x85,0x28,0xe3,0xb7,0xc3,0x01,0xa8,0x82,0xc3,0x23,0xd2,0xee,0xbc,0x95,0x1c,0x6d,0xce,0xfc,0x8d,0xd6,0xa5,0x9e,0x21,0xc2,0x6a};
    static std::uint8_t b3[32] = {0x0b,0xe5,0xdb,0xba,0xda,0x5b,0xbe,0xca,0x98,0x6f,0x79,0x0e,0x9d,0x1d,0x34,0x51,0x04,0xdc,0xd6,0xf3,0xa9,0x09,0x0b,0x95,0x55,0x20,0x5e,0x39,0x56,0x80,0x46,0x36};
    static std::uint8_t c3[32] = {0x8e,0x74,0xc8,0x1e,0xc3,0xb2,0xf3,0xba,0x90,0x74,0x3e,0xb4,0x64,0x8b,0x4e,0x72,0x1e,0xf6,0x17,0xc8,0xec,0x13,0x62,0x39,0xa7,0x6d,0x78,0x6c,0x47,0xa1,0x7c,0x34};
    sm9_fn_from_bytes(a, a3);
    sm9_fn_from_bytes(b, b3);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c3, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a4[32] = {0x21,0x01,0x07,0x01,0xc0,0x5a,0x1a,0x65,0x79,0x01,0x7d,0x2f,0x22,0xc6,0x02,0xec,0x0c,0xce,0xf1,0x71,0x39,0x66,0xa1,0x56,0x14,0x0c,0x13,0xfb,0xbb,0x48,0xb1,0x24};
    static std::uint8_t b4[32] = {0x2b,0x2b,0x3d,0x5d,0xe2,0xe1,0x70,0x03,0x02,0xfd,0xd5,0x03,0x1b,0x7a,0xf1,0x31,0xf3,0x16,0xba,0xb5,0xb1,0x22,0x70,0x2d,0xa8,0x82,0x9b,0xae,0x2e,0x6d,0x79,0x4c};
    static std::uint8_t c4[32] = {0xac,0x15,0xc9,0xa3,0xe0,0x1c,0x51,0x54,0x4c,0x07,0x53,0x7b,0xfc,0xd9,0xd8,0xfe,0x63,0xaa,0xca,0x06,0xa1,0x2e,0xbd,0x17,0x50,0xf8,0x59,0xea,0x63,0x7a,0x06,0xfd};
    sm9_fn_from_bytes(a, a4);
    sm9_fn_from_bytes(b, b4);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c4, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a5[32] = {0x12,0xfb,0x76,0x09,0x24,0x8b,0x05,0x0a,0xe6,0x14,0x3a,0x13,0x2b,0x6c,0xe0,0xef,0xaf,0x63,0x73,0x3c,0x05,0x33,0x6c,0x74,0x65,0x47,0x57,0x31,0xaa,0x86,0x46,0x25};
    static std::uint8_t b5[32] = {0x6b,0x84,0x56,0x1d,0x2d,0x03,0xc8,0x58,0x28,0xe4,0x8e,0x5f,0x73,0xaf,0x26,0xa1,0x14,0xe6,0x50,0xe0,0x7e,0x14,0xac,0xad,0xcf,0x92,0x0d,0xe2,0x63,0xc9,0x90,0x36};
    static std::uint8_t c5[32] = {0x5d,0xb7,0x1f,0xeb,0xfa,0x2a,0xe3,0xa4,0x93,0x33,0x57,0x03,0xad,0x4c,0x81,0x92,0xe4,0x6f,0xb5,0xa6,0xa0,0x09,0x4b,0xb5,0x7b,0x24,0x2a,0xec,0x1d,0x5b,0x85,0x14};
    sm9_fn_from_bytes(a, a5);
    sm9_fn_from_bytes(b, b5);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c5, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a6[32] = {0x9c,0x7a,0xdb,0xf4,0xdd,0x7f,0xfb,0xc2,0xa8,0x35,0x75,0xb8,0x2f,0xef,0x59,0x4f,0x62,0xe4,0x8d,0x50,0x59,0xce,0xf0,0xe6,0x65,0xb5,0x51,0xd6,0xe2,0x16,0x08,0x94};
    static std::uint8_t b6[32] = {0x16,0x65,0x35,0xec,0x18,0xad,0xf7,0x8f,0x07,0x48,0x61,0x2b,0x2e,0x75,0xd8,0x61,0xd8,0x62,0x94,0x39,0x3d,0xd1,0xf1,0xea,0x6a,0x55,0xfe,0x8c,0xba,0xe6,0xd9,0xd9};
    static std::uint8_t c6[32] = {0x86,0x15,0xa6,0x08,0xc4,0xd2,0x04,0x33,0xa0,0xed,0x14,0x8d,0x01,0x79,0x80,0xed,0x8a,0x81,0xf9,0x17,0x1b,0xfc,0xfe,0xfb,0xfb,0x5f,0x53,0x4a,0x27,0x2f,0x2e,0xbb};
    sm9_fn_from_bytes(a, a6);
    sm9_fn_from_bytes(b, b6);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c6, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a7[32] = {0x84,0x21,0x8b,0x47,0x6c,0xf2,0xbd,0xbb,0x70,0x07,0xae,0x5f,0x82,0xbe,0x31,0xd4,0x47,0x05,0xc1,0xef,0xfb,0x46,0x25,0x63,0x23,0xcc,0xc7,0x61,0x78,0x83,0xac,0x6e};
    static std::uint8_t b7[32] = {0x88,0xa3,0xc1,0xac,0x6b,0x87,0xca,0xac,0xc3,0x36,0xe3,0xdc,0xd6,0x47,0x4b,0xf9,0xaa,0xe5,0x45,0x91,0x2f,0x04,0xd5,0x64,0xef,0x8f,0xd0,0x50,0x3b,0x27,0x4e,0x89};
    static std::uint8_t c7[32] = {0xb1,0xbd,0xc9,0x9b,0x04,0x0e,0x9a,0x00,0x82,0xd4,0x75,0xd2,0xa2,0x05,0xad,0x1e,0xe6,0x13,0x0f,0xa9,0xe5,0x2b,0xdb,0xed,0x19,0xab,0xd8,0xae,0x13,0xfb,0x2d,0x0a};
    sm9_fn_from_bytes(a, a7);
    sm9_fn_from_bytes(b, b7);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c7, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a8[32] = {0x12,0x85,0xc1,0xfd,0xf5,0xbe,0xcb,0xbf,0x26,0x2d,0x8a,0xcb,0xf8,0xfe,0x3a,0x56,0x77,0x84,0x60,0x0c,0xad,0xd5,0x5e,0x53,0xd0,0x2c,0x61,0x7f,0x45,0xfe,0x7a,0xfb};
    static std::uint8_t b8[32] = {0xa6,0xef,0x14,0x8b,0xe8,0x93,0xd3,0x0b,0x9b,0x28,0xf0,0x93,0x07,0x2f,0x15,0xe9,0xd5,0x9f,0xfe,0x15,0x4e,0xc8,0x4f,0x72,0xa0,0x5e,0x62,0x9b,0x6f,0xbd,0x2c,0xea};
    static std::uint8_t c8[32] = {0x21,0xd6,0xad,0x72,0x0f,0xce,0x9f,0xa5,0x61,0x08,0x45,0x88,0xe7,0x5d,0xeb,0xb0,0xeb,0xd6,0xf5,0x42,0x77,0xf7,0x9a,0xd0,0x15,0x3c,0xe0,0x80,0xac,0xe0,0x1d,0x36};
    sm9_fn_from_bytes(a, a8);
    sm9_fn_from_bytes(b, b8);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c8, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a9[32] = {0x09,0x6c,0xfe,0x99,0xde,0x5e,0x82,0xb4,0x94,0x17,0xe2,0xbc,0xdc,0xbe,0x6d,0x6f,0x03,0x30,0xa0,0xac,0x66,0x5f,0xe2,0xe7,0xd1,0xd9,0xce,0x83,0x98,0xc9,0x8f,0x76};
    static std::uint8_t b9[32] = {0x38,0xcf,0xf5,0x09,0x88,0x9f,0xce,0x29,0xed,0x85,0x5f,0x38,0x73,0x35,0x18,0xdc,0x37,0xc0,0x76,0xfb,0xa0,0x39,0x3c,0xdf,0xe1,0x23,0xbe,0x65,0x4c,0xb5,0x87,0xa4};
    static std::uint8_t c9[32] = {0x86,0xdd,0x09,0x90,0x58,0x62,0x5b,0x7c,0x7c,0x96,0x2e,0xd4,0x5f,0x18,0x1b,0xd7,0x15,0x62,0xbc,0xfb,0xdf,0x11,0x31,0xf6,0xd6,0x24,0xf1,0xbb,0x22,0xb2,0xd6,0xf7};
    sm9_fn_from_bytes(a, a9);
    sm9_fn_from_bytes(b, b9);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c9, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a10[32] = {0x3c,0x79,0x68,0x31,0x3c,0x80,0xcc,0xe0,0x5d,0xc4,0x97,0xa3,0xb5,0x98,0xb5,0x44,0x85,0x6f,0xa2,0xc5,0x3b,0x86,0xd5,0x13,0x92,0xff,0x3c,0x34,0x47,0xf7,0x40,0x92};
    static std::uint8_t b10[32] = {0x42,0x45,0xba,0xbc,0xbc,0x89,0x31,0x8e,0xe4,0x7f,0xc5,0x1a,0xbb,0x36,0x18,0x29,0xfd,0x30,0x6d,0xb9,0x09,0xa8,0xe4,0xe5,0x0f,0x79,0x68,0x81,0x9b,0xbb,0x92,0x22};
    static std::uint8_t c10[32] = {0xb0,0x73,0xad,0x74,0x82,0x9b,0x42,0x43,0x4f,0x48,0x7d,0xd8,0xef,0xf1,0x64,0x5e,0xd2,0x31,0xc8,0x57,0x4a,0xc8,0x7c,0x1d,0x68,0xf4,0xb5,0x4f,0x82,0xda,0x7d,0x95};
    sm9_fn_from_bytes(a, a10);
    sm9_fn_from_bytes(b, b10);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c10, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a11[32] = {0x5c,0xe4,0xa8,0x51,0x09,0xa6,0x94,0x3e,0xdd,0x68,0x35,0xf6,0x6c,0xa5,0xee,0x9d,0x32,0x21,0xc8,0xf0,0x87,0x38,0xad,0x0a,0xae,0x83,0xb7,0x0e,0x20,0x92,0xdd,0xa0};
    static std::uint8_t b11[32] = {0x64,0xce,0x06,0x6e,0x0b,0xda,0x9b,0x83,0xf0,0x2f,0x51,0xfa,0x37,0x6d,0xc5,0x45,0x55,0x3d,0x63,0xcc,0x85,0xfc,0x4b,0x59,0xaa,0xda,0x19,0x69,0xb2,0x01,0xe7,0xce};
    static std::uint8_t c11[32] = {0xae,0x56,0xa1,0xe3,0x00,0x6f,0x9f,0xac,0xc3,0x3c,0x8f,0x4c,0x2a,0xc6,0xf0,0x9c,0x26,0xd6,0xf8,0x6f,0x1a,0x26,0xed,0x9f,0xe9,0x18,0x7f,0x41,0x45,0x2f,0xc4,0xf7};
    sm9_fn_from_bytes(a, a11);
    sm9_fn_from_bytes(b, b11);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c11, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a12[32] = {0x14,0x79,0x9f,0x79,0x4b,0x8f,0xd2,0x8d,0x84,0x55,0xea,0x4c,0xbc,0xa8,0x55,0xe2,0xd7,0xa8,0x1c,0x98,0x5b,0x01,0x2c,0x22,0xd0,0x01,0xbd,0xb6,0xff,0x53,0x0a,0x69};
    static std::uint8_t b12[32] = {0x1a,0x49,0x0d,0xd7,0x5e,0x0b,0x0f,0x10,0x03,0x49,0x4b,0xbe,0xbb,0x75,0x38,0xda,0xe1,0xd5,0x04,0xd3,0x11,0xaf,0xd0,0x2d,0xa9,0xdf,0x81,0x79,0xa8,0xf2,0x00,0x71};
    static std::uint8_t c12[32] = {0xb0,0x70,0x91,0xa1,0xf0,0x28,0x6a,0x6f,0x57,0x10,0x49,0xdd,0xf6,0xc1,0xe4,0x4c,0x3f,0xc5,0xab,0x10,0x62,0x3b,0xe7,0xe4,0x0b,0x91,0x1d,0xda,0x2c,0xff,0xd9,0x1d};
    sm9_fn_from_bytes(a, a12);
    sm9_fn_from_bytes(b, b12);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c12, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a13[32] = {0xb4,0x2c,0x35,0xfd,0x2b,0xb0,0xf9,0x15,0x99,0x50,0xba,0x81,0xa3,0x85,0xde,0x36,0xd2,0x28,0x77,0xc5,0x9d,0x48,0xd2,0xe8,0xf4,0x14,0x7c,0x52,0xa9,0xcb,0x67,0xcb};
    static std::uint8_t b13[32] = {0xaf,0x69,0xea,0xec,0xa0,0x77,0xbc,0xf8,0x4f,0x36,0x01,0x0b,0x4a,0x67,0x3b,0x40,0x7b,0xfb,0x39,0x6f,0x20,0x6f,0xce,0xf2,0x23,0x46,0x0e,0x9c,0x15,0xe0,0xbd,0x51};
    static std::uint8_t c13[32] = {0x04,0xc2,0x4b,0x10,0x8b,0x39,0x3c,0x1d,0x4a,0x1a,0xb9,0x76,0x59,0x1e,0xa2,0xf6,0x56,0x2d,0x3e,0x56,0x7c,0xd9,0x03,0xf6,0xd0,0xce,0x6d,0xb6,0x93,0xea,0xaa,0x7a};
    sm9_fn_from_bytes(a, a13);
    sm9_fn_from_bytes(b, b13);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c13, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a14[32] = {0x16,0x79,0x07,0xb6,0x82,0x18,0x09,0x22,0x05,0xba,0x7b,0x80,0xb8,0x8e,0x28,0xe6,0x7a,0xa7,0x46,0x14,0x77,0x92,0xc3,0xdd,0x41,0x32,0x37,0x3d,0xe5,0xa3,0x85,0xe2};
    static std::uint8_t b14[32] = {0x00,0x53,0x27,0xce,0x26,0x42,0xa1,0xbc,0x6c,0x90,0x53,0x5e,0xfe,0x0d,0x5c,0x78,0xff,0x70,0xea,0xfc,0x8f,0x56,0x2f,0x5e,0xee,0xe0,0x1b,0x90,0x41,0x59,0x62,0xeb};
    static std::uint8_t c14[32] = {0x16,0x25,0xdf,0xe8,0x5b,0xd5,0x67,0x65,0x99,0x2a,0x28,0x21,0xba,0x80,0xcc,0x6d,0x7b,0x36,0x5b,0x17,0xe8,0x3c,0x94,0x7e,0x52,0x52,0x1b,0xad,0xa4,0x4a,0x22,0xf7};
    sm9_fn_from_bytes(a, a14);
    sm9_fn_from_bytes(b, b14);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c14, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a15[32] = {0x28,0x10,0xd5,0x4f,0xfa,0xff,0x82,0xdb,0x31,0x7c,0xbb,0x5e,0x48,0x3d,0x87,0x6d,0xdb,0x55,0x1d,0x02,0xac,0xaf,0x79,0xd7,0x78,0xb6,0x00,0xb6,0x1a,0x3f,0xaa,0xb1};
    static std::uint8_t b15[32] = {0x6c,0xb7,0xa5,0x2b,0xd3,0x15,0x46,0xec,0x3f,0x17,0xea,0xe7,0x66,0xbc,0x7a,0x36,0xcd,0x56,0xcd,0x48,0x7a,0x4a,0xac,0x57,0x37,0xfa,0x3f,0x79,0xc8,0x6e,0x20,0x8b};
    static std::uint8_t c15[32] = {0x71,0x99,0x30,0x24,0x2a,0x8d,0xe2,0xe0,0xc8,0x68,0x7b,0xc6,0xd7,0x0f,0xd4,0x7b,0x57,0xf0,0xe3,0x05,0x4b,0x4f,0x59,0x6f,0x26,0x2a,0xa2,0xd9,0x28,0x70,0x59,0x4b};
    sm9_fn_from_bytes(a, a15);
    sm9_fn_from_bytes(b, b15);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c15, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a16[32] = {0x83,0xb9,0xea,0xb5,0x1c,0x01,0x37,0xbf,0x5c,0x2d,0x56,0xa6,0xb2,0x6a,0x23,0xed,0xbb,0xe2,0xfd,0x72,0x40,0xa8,0xc0,0x79,0x6f,0x94,0xa4,0x20,0xf9,0x7d,0xeb,0x43};
    static std::uint8_t b16[32] = {0x01,0x23,0xc6,0x9d,0xf7,0x0f,0x99,0x25,0x9c,0xc3,0xe4,0xf2,0xfa,0x2d,0x42,0xda,0x52,0x2a,0x20,0x01,0xfc,0x41,0x29,0xfc,0x4c,0xdc,0x53,0x71,0x42,0x2f,0x7e,0x2d};
    static std::uint8_t c16[32] = {0x82,0x96,0x24,0x17,0x24,0xf1,0x9e,0x99,0xbf,0x69,0x71,0xb3,0xb8,0x3c,0xe1,0x13,0x69,0xb8,0xdd,0x70,0x44,0x67,0x96,0x7d,0x22,0xb8,0x50,0xaf,0xb7,0x4e,0x6d,0x16};
    sm9_fn_from_bytes(a, a16);
    sm9_fn_from_bytes(b, b16);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c16, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a17[32] = {0x21,0xe4,0xd3,0x4d,0xae,0xbd,0x65,0x7b,0x49,0x81,0x2d,0xa4,0x88,0x47,0x8d,0x45,0x0c,0x7e,0x86,0x92,0x9d,0x58,0xce,0xfd,0x31,0xcc,0x06,0xcd,0xa5,0xbe,0xa8,0x41};
    static std::uint8_t b17[32] = {0x08,0xc7,0xcf,0x3a,0xbe,0x14,0xd8,0x52,0xb9,0xa0,0x12,0xb1,0x40,0x12,0x6d,0x13,0x86,0x7b,0x9c,0x75,0x31,0xcc,0x06,0xe1,0xde,0x0d,0xd8,0x40,0x63,0xc7,0xc8,0xc8};
    static std::uint8_t c17[32] = {0x19,0x1d,0x04,0x12,0xf0,0xa8,0x8d,0x28,0x8f,0xe1,0x1a,0xf3,0x48,0x35,0x20,0x31,0x86,0x02,0xea,0x1d,0x6b,0x8c,0xc8,0x1b,0x53,0xbe,0x2e,0x8d,0x41,0xf6,0xdf,0x79};
    sm9_fn_from_bytes(a, a17);
    sm9_fn_from_bytes(b, b17);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c17, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a18[32] = {0x50,0x5a,0xe0,0x58,0xdd,0x1e,0x08,0xd0,0x4b,0x9e,0x8a,0x97,0xd7,0x89,0xc7,0x52,0x15,0xff,0xa0,0xe1,0x63,0xdf,0x05,0x85,0x23,0x21,0xf0,0x1f,0x0b,0xec,0xc8,0xa7};
    static std::uint8_t b18[32] = {0x42,0x4a,0x1d,0xef,0x9f,0xf5,0x10,0x87,0x16,0xd6,0xf1,0xe9,0x18,0x7a,0x5c,0x74,0xd5,0x42,0x1f,0x91,0xab,0x65,0x17,0xad,0x07,0x10,0x39,0xd5,0xc6,0xde,0x83,0xad};
    static std::uint8_t c18[32] = {0x0e,0x10,0xc2,0x69,0x3d,0x28,0xf8,0x49,0x34,0xc7,0x98,0xae,0xbf,0x0f,0x6a,0xdd,0x40,0xbd,0x81,0x4f,0xb8,0x79,0xed,0xd8,0x1c,0x11,0xb6,0x49,0x45,0x0e,0x44,0xfa};
    sm9_fn_from_bytes(a, a18);
    sm9_fn_from_bytes(b, b18);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c18, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a19[32] = {0x63,0x46,0xbd,0x0f,0xa8,0xc4,0x94,0x4e,0x8d,0x97,0x0d,0x4a,0x32,0xfa,0xae,0x77,0xa0,0x47,0x14,0x22,0x67,0x96,0x96,0xa8,0x7b,0x60,0x23,0x65,0xd9,0xb5,0xc4,0x3c};
    static std::uint8_t b19[32] = {0x19,0x4f,0x8c,0xe2,0x48,0x18,0x8e,0xd8,0x98,0x79,0x22,0x6c,0x01,0x13,0xe3,0xdc,0xbc,0xd3,0xc9,0x6f,0x0a,0x63,0xb5,0x43,0x98,0x53,0xb2,0xbc,0xe8,0xec,0xd8,0x4c};
    static std::uint8_t c19[32] = {0x49,0xf7,0x30,0x2d,0x60,0xac,0x05,0x75,0xf5,0x1d,0xea,0xde,0x31,0xe6,0xca,0x9a,0xe3,0x73,0x4a,0xb3,0x5d,0x32,0xe1,0x64,0xe3,0x0c,0x70,0xa8,0xf0,0xc8,0xeb,0xf0};
    sm9_fn_from_bytes(a, a19);
    sm9_fn_from_bytes(b, b19);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c19, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a20[32] = {0x27,0x9d,0xf0,0x7f,0xcf,0x6b,0xca,0x3e,0x50,0xea,0xc5,0xfb,0x92,0xf2,0x5c,0xbf,0x4a,0xad,0xac,0x81,0xff,0x4f,0x2b,0xf5,0xd2,0xf9,0x7f,0xeb,0x03,0x62,0x5a,0x91};
    static std::uint8_t b20[32] = {0x4e,0x01,0xbe,0xaa,0x3a,0x6e,0x74,0x57,0xcd,0x47,0xea,0x96,0xab,0x3b,0xd6,0x13,0x2d,0x7c,0x21,0xec,0x61,0x36,0xeb,0x55,0xfe,0x6b,0xbe,0x6c,0xe1,0x1a,0xdd,0xc5};
    static std::uint8_t c20[32] = {0x8f,0xdc,0x31,0xd5,0x97,0xa0,0xfc,0xd8,0x59,0xa6,0x86,0xb4,0xdd,0x45,0x4d,0xf0,0x67,0x24,0x1d,0xe0,0xb7,0x02,0xcc,0x8e,0xb9,0xfc,0xa3,0x1a,0xf8,0xe6,0x4b,0xf1};
    sm9_fn_from_bytes(a, a20);
    sm9_fn_from_bytes(b, b20);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c20, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a21[32] = {0x33,0xe1,0x59,0x50,0x61,0x90,0x12,0xa7,0x5d,0xb3,0xa7,0x7f,0xe6,0xe3,0x1b,0x10,0xae,0xd9,0x6a,0x20,0xb5,0x2e,0x94,0x56,0x19,0xdd,0x6c,0x94,0xcb,0x9c,0xcd,0xc3};
    static std::uint8_t b21[32] = {0x9d,0xe4,0x61,0x8d,0xd6,0x4e,0x92,0x94,0x5d,0x5c,0xc4,0xbe,0xb8,0x8c,0xb0,0xc0,0xe8,0xa6,0x51,0x5b,0x48,0x10,0xfd,0xb7,0xcf,0xf9,0x8e,0x4a,0xf7,0xc1,0x11,0xde};
    static std::uint8_t c21[32] = {0x4c,0x3c,0xf7,0xc2,0x8d,0xe5,0x27,0x04,0xd6,0x5a,0x8e,0x11,0x23,0xe5,0x31,0x94,0x10,0x25,0xac,0x10,0x86,0x08,0x22,0x8d,0x2f,0x52,0xbf,0xe6,0xaa,0x7a,0x8b,0x0a};
    sm9_fn_from_bytes(a, a21);
    sm9_fn_from_bytes(b, b21);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c21, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a22[32] = {0x10,0x2d,0x04,0xa0,0x85,0x7e,0x06,0x1b,0xaf,0xee,0x27,0x47,0xc8,0x3b,0x13,0x12,0x21,0x0a,0x14,0xf3,0x15,0x46,0xc9,0x26,0x20,0x63,0x1e,0x2a,0x58,0xf2,0x42,0x3b};
    static std::uint8_t b22[32] = {0x76,0x22,0xa5,0x50,0x9b,0x55,0xbd,0x5c,0x0d,0x63,0xa9,0x82,0xbc,0x90,0xf0,0xf1,0x50,0x92,0x7d,0xad,0xff,0x21,0x1c,0x2d,0x4d,0xd2,0x78,0xdd,0x4f,0xa0,0x58,0xe6};
    static std::uint8_t c22[32] = {0x50,0x4a,0x5f,0x4f,0xec,0xcb,0xef,0xb1,0x78,0x8e,0x29,0x15,0x01,0x38,0xe9,0x65,0x1a,0x6a,0x2a,0x90,0x2f,0x10,0x38,0xe7,0xb7,0xff,0x86,0xe9,0xdf,0xf0,0xb8,0x7a};
    sm9_fn_from_bytes(a, a22);
    sm9_fn_from_bytes(b, b22);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c22, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a23[32] = {0x49,0x21,0xc0,0x7e,0xff,0x0c,0xc7,0x2e,0xbb,0xae,0xa1,0x6d,0x60,0x34,0xfb,0x09,0xa9,0xa1,0xbe,0xc2,0x7c,0x9b,0xad,0x15,0x55,0x2e,0xad,0x1b,0x08,0xf7,0x89,0x9f};
    static std::uint8_t b23[32] = {0x1c,0xe3,0x73,0x0e,0x4e,0x3f,0xbd,0xde,0x49,0x7a,0x70,0xec,0xaa,0x8f,0x77,0x63,0x9c,0x0c,0x93,0x1f,0x07,0x55,0x49,0xb1,0x2f,0xa8,0x02,0x02,0x77,0xe6,0x7c,0x62};
    static std::uint8_t c23[32] = {0x2c,0x3e,0x4d,0x70,0xb0,0xcd,0x09,0x50,0x72,0x34,0x30,0x80,0xb5,0xa5,0x83,0xa6,0x0d,0x95,0x2b,0xa3,0x75,0x46,0x63,0x64,0x25,0x86,0xab,0x18,0x91,0x11,0x0d,0x3d};
    sm9_fn_from_bytes(a, a23);
    sm9_fn_from_bytes(b, b23);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c23, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a24[32] = {0x9c,0x9c,0x84,0xbe,0x4a,0x42,0xbb,0x6b,0x3a,0x9e,0x3b,0xd6,0xa8,0x34,0xa1,0x6c,0x7c,0xf9,0x36,0x32,0x44,0xad,0x83,0x9c,0xa6,0x64,0x00,0xe1,0x84,0x90,0xf7,0xda};
    static std::uint8_t b24[32] = {0x59,0xc4,0x51,0xdd,0xb9,0x3b,0xa7,0x8b,0xe6,0x16,0x18,0x95,0xf0,0x81,0x9a,0x67,0xd3,0x82,0x98,0x67,0xed,0x14,0xfd,0xeb,0x61,0x1e,0x96,0xd4,0x84,0x12,0x95,0x22};
    static std::uint8_t c24[32] = {0x42,0xd8,0x32,0xe0,0x91,0x07,0x13,0xdf,0x54,0x88,0x23,0x40,0xb7,0xb3,0x07,0x04,0xa9,0x76,0x9d,0xca,0x57,0x98,0x85,0xb1,0x45,0x45,0x6a,0x0d,0x00,0x7e,0x62,0xb8};
    sm9_fn_from_bytes(a, a24);
    sm9_fn_from_bytes(b, b24);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c24, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a25[32] = {0x6d,0x54,0xdb,0x32,0x08,0x92,0xe9,0x60,0x8a,0x90,0xd7,0x3c,0x4f,0xf9,0xf4,0x9c,0x0a,0xd5,0x59,0xb4,0xa8,0x1c,0x28,0x7b,0xc1,0xe6,0x3d,0x60,0x96,0xae,0x7a,0xcc};
    static std::uint8_t b25[32] = {0x11,0xc4,0xc4,0x18,0x05,0x9b,0xfc,0x87,0x50,0xe0,0x73,0x9a,0x98,0xef,0xe4,0x9e,0x47,0x4f,0x2c,0x98,0x90,0x6a,0x50,0x46,0x56,0x6e,0x4f,0x2a,0xfb,0x7d,0x13,0xd5};
    static std::uint8_t c25[32] = {0x5b,0x90,0x17,0x1a,0x02,0xf6,0xec,0xd9,0x39,0xb0,0x63,0xa1,0xb7,0x0a,0x0f,0xfd,0xc3,0x86,0x2d,0x1c,0x17,0xb1,0xd8,0x35,0x6b,0x77,0xee,0x35,0x9b,0x31,0x66,0xf7};
    sm9_fn_from_bytes(a, a25);
    sm9_fn_from_bytes(b, b25);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c25, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a26[32] = {0x32,0xf1,0xd2,0xd8,0xa6,0x11,0xee,0x0d,0xdd,0x3f,0xca,0xc0,0xed,0x4c,0x49,0xc9,0xf7,0x04,0xaf,0x97,0x08,0x7c,0x0a,0xe8,0x6f,0x09,0x94,0xd9,0x12,0x63,0x90,0xd6};
    static std::uint8_t b26[32] = {0x1e,0x93,0xb5,0x06,0xd4,0x5d,0xbd,0x18,0x55,0xc0,0xbc,0xc1,0x36,0xd1,0xff,0xb4,0xec,0x63,0xdc,0x4a,0x0e,0xb1,0x76,0x51,0x48,0x1b,0x88,0x89,0xd2,0x0c,0x7c,0x06};
    static std::uint8_t c26[32] = {0x14,0x5e,0x1d,0xd1,0xd1,0xb4,0x30,0xf5,0x87,0x7f,0x0d,0xff,0xb6,0x7a,0x4a,0x15,0x0a,0xa0,0xd3,0x4c,0xf9,0xca,0x94,0x97,0x26,0xee,0x0c,0x4f,0x40,0x57,0x14,0xd0};
    sm9_fn_from_bytes(a, a26);
    sm9_fn_from_bytes(b, b26);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c26, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a27[32] = {0xa4,0xae,0x46,0x46,0x2d,0xc9,0xfa,0x6e,0xa1,0x59,0xd7,0x20,0x90,0x22,0x98,0x26,0x21,0x2b,0x9c,0xff,0xe6,0x50,0xe5,0x51,0xed,0xd9,0xac,0x0e,0xed,0x33,0xe5,0x5e};
    static std::uint8_t b27[32] = {0x5c,0x9e,0x0f,0xf1,0x36,0x06,0x55,0x72,0x93,0x7e,0x4d,0x19,0x8c,0xdc,0xca,0x0c,0x51,0x55,0x19,0xc1,0x8c,0x8d,0x23,0xf0,0xa2,0x53,0x44,0x89,0xdd,0x47,0x4e,0xb6};
    static std::uint8_t c27[32] = {0x48,0x10,0x36,0x54,0xf7,0xc3,0xa4,0xfc,0x0d,0xdb,0x8a,0x07,0x03,0x45,0xce,0x19,0xcf,0xd6,0x83,0x3e,0x59,0xc3,0xc1,0x61,0x4b,0x86,0x67,0x85,0x0f,0xec,0x96,0xa8};
    sm9_fn_from_bytes(a, a27);
    sm9_fn_from_bytes(b, b27);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c27, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a28[32] = {0x0e,0xf9,0xee,0xe1,0xc9,0xfe,0x7d,0x34,0xd6,0x6b,0x12,0x2f,0x42,0x86,0xde,0x77,0x88,0xc2,0xf6,0x7b,0xc3,0x2a,0x7b,0x11,0x94,0x71,0x77,0x96,0x20,0xa4,0x5e,0x9f};
    static std::uint8_t b28[32] = {0x09,0x18,0xc7,0x0a,0x5c,0x82,0x37,0x59,0x82,0xfd,0xbc,0x24,0x3e,0x4b,0x47,0xdf,0x17,0xf7,0xa4,0xb8,0xed,0x39,0x54,0xd7,0x82,0xba,0xc0,0x70,0x02,0xb4,0x41,0xed};
    static std::uint8_t c28[32] = {0x05,0xe1,0x27,0xd7,0x6d,0x7c,0x45,0xdb,0x53,0x6d,0x56,0x0b,0x04,0x3b,0x96,0x98,0x70,0xcb,0x51,0xc2,0xd5,0xf1,0x26,0x3a,0x11,0xb6,0xb7,0x26,0x1d,0xf0,0x1c,0xb2};
    sm9_fn_from_bytes(a, a28);
    sm9_fn_from_bytes(b, b28);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c28, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a29[32] = {0x71,0x8c,0x4b,0x43,0xa1,0xa5,0xeb,0xd2,0x14,0x7a,0xd0,0x77,0x1b,0x23,0x26,0x3e,0x72,0x8a,0x05,0xd4,0x04,0x7a,0x0f,0x51,0x50,0xaf,0x5b,0xd6,0xcd,0x6b,0xb6,0x1e};
    static std::uint8_t b29[32] = {0x16,0x0b,0x10,0xcc,0x4d,0x6b,0xfc,0xcf,0xa9,0x1c,0x06,0xc9,0x41,0x63,0xac,0xa9,0x7c,0xc7,0x91,0x84,0xc9,0x88,0x75,0x59,0x07,0x80,0x95,0xc4,0xb3,0xdb,0x45,0x6f};
    static std::uint8_t c29[32] = {0x5b,0x81,0x3a,0x77,0x54,0x39,0xef,0x02,0x6b,0x5e,0xc9,0xad,0xd9,0xbf,0x79,0x94,0xf5,0xc2,0x74,0x4f,0x3a,0xf1,0x99,0xf8,0x49,0x2e,0xc6,0x12,0x19,0x90,0x70,0xaf};
    sm9_fn_from_bytes(a, a29);
    sm9_fn_from_bytes(b, b29);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c29, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a30[32] = {0x22,0x95,0x3c,0x5b,0x55,0xdb,0x65,0xd7,0xf0,0x3f,0x95,0x76,0x83,0x2a,0x34,0xf0,0x47,0x97,0x7b,0x1d,0x65,0xae,0xd9,0xf4,0x89,0x29,0x6f,0x06,0x15,0x91,0xf5,0xa1};
    static std::uint8_t b30[32] = {0x46,0x28,0x0b,0xe6,0x12,0x77,0x3e,0x71,0x26,0x0d,0x77,0xa6,0x5d,0xab,0x8a,0x90,0x28,0x0f,0x41,0x8c,0x2d,0x7f,0x0e,0xd1,0x1c,0x50,0xee,0x06,0x3e,0x8d,0x00,0x85};
    static std::uint8_t c30[32] = {0x92,0xad,0x30,0x75,0x46,0x07,0xce,0x58,0xa0,0x35,0xc9,0x20,0x1b,0x0d,0x71,0xa4,0x69,0x7a,0xcc,0xdc,0x51,0x1a,0x57,0x12,0x52,0x47,0x62,0x9c,0xad,0xa3,0xc4,0x41};
    sm9_fn_from_bytes(a, a30);
    sm9_fn_from_bytes(b, b30);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c30, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a31[32] = {0x54,0xd6,0x76,0x60,0x5b,0x01,0xc6,0x47,0x03,0x3c,0x49,0xd3,0x7d,0x05,0x28,0x41,0xa8,0xf4,0xca,0x3d,0x93,0x76,0xf7,0x12,0xf0,0x0a,0x6b,0x2f,0x9b,0xc1,0x93,0xb1};
    static std::uint8_t b31[32] = {0x3f,0x03,0xff,0x12,0x98,0x5b,0x77,0x3f,0xd2,0xde,0x23,0x0d,0x44,0xdb,0x02,0xd1,0x87,0xf1,0x12,0x3f,0xb1,0x18,0x5e,0x28,0x3d,0x43,0xf7,0xbe,0x5a,0xd0,0xc1,0x4a};
    static std::uint8_t c31[32] = {0x15,0xd2,0x77,0x4d,0xc2,0xa6,0x4f,0x07,0x30,0x5e,0x26,0xc6,0x38,0x2a,0x25,0x70,0x21,0x03,0xb7,0xfd,0xe2,0x5e,0x98,0xea,0xb2,0xc6,0x73,0x71,0x40,0xf0,0xd2,0x67};
    sm9_fn_from_bytes(a, a31);
    sm9_fn_from_bytes(b, b31);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c31, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a32[32] = {0x17,0x12,0xfe,0x7a,0x30,0x02,0x0b,0x78,0x78,0x5b,0x85,0x00,0x90,0xcb,0xe8,0x41,0x49,0xe6,0x93,0xc6,0x8e,0x42,0x2c,0xed,0xb1,0x6d,0x5f,0x50,0xbe,0x61,0x7d,0x54};
    static std::uint8_t b32[32] = {0x8d,0x59,0xb9,0xcf,0x20,0x5d,0xa8,0x55,0x25,0x86,0x3a,0x64,0xd2,0x0b,0x11,0xd1,0xdb,0xd0,0x09,0xa5,0xfa,0xcc,0x7d,0x0e,0x96,0x27,0x30,0xe8,0xc0,0x86,0x4e,0xe3};
    static std::uint8_t c32[32] = {0x3f,0xf9,0x44,0xab,0x12,0x48,0x0a,0x15,0x28,0xd8,0xf5,0xeb,0xb4,0x4f,0x9d,0xb3,0xb8,0x09,0x1d,0x6b,0xac,0x60,0x3b,0xce,0x00,0xb5,0x10,0x04,0xd4,0x79,0xfd,0x96};
    sm9_fn_from_bytes(a, a32);
    sm9_fn_from_bytes(b, b32);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c32, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a33[32] = {0xa5,0xe3,0xa5,0x4f,0xee,0x15,0xc4,0x07,0x8e,0xd5,0xd8,0xf8,0xb4,0x03,0x20,0x26,0x3c,0xe5,0x79,0x8a,0x9a,0x1a,0x8e,0xc3,0x90,0x02,0x51,0x93,0x36,0x3d,0xd3,0x3c};
    static std::uint8_t b33[32] = {0x25,0x4c,0x27,0xaa,0x7b,0x04,0xc4,0x3c,0xc6,0xe2,0x53,0xe7,0x16,0xd8,0x2c,0x28,0xbc,0x16,0xf9,0xb4,0xac,0x91,0x51,0xc4,0x9b,0x7b,0x65,0x0b,0x29,0x00,0x41,0x1f};
    static std::uint8_t c33[32] = {0x80,0x97,0x7d,0xa5,0x73,0x10,0xff,0xca,0xc7,0xf3,0x85,0x11,0x9d,0x2a,0xf3,0xfd,0x80,0xce,0x7f,0xd5,0xed,0x89,0x3c,0xfe,0xf4,0x86,0xec,0x88,0x0d,0x3d,0x92,0x1d};
    sm9_fn_from_bytes(a, a33);
    sm9_fn_from_bytes(b, b33);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c33, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a34[32] = {0x66,0xdb,0xaa,0xc9,0x4a,0x26,0xbf,0x0a,0x97,0x3b,0x72,0xff,0x18,0x90,0xd6,0xe7,0xab,0x56,0x6a,0x4f,0x83,0x35,0xd1,0x93,0x6b,0x73,0xb9,0x40,0x82,0x36,0x00,0x08};
    static std::uint8_t b34[32] = {0x0f,0x58,0xf8,0x31,0xad,0x5e,0xb9,0x8a,0xfc,0xe7,0x8a,0xee,0xc0,0x45,0x93,0x77,0xa7,0x8c,0xff,0xf8,0x39,0xa7,0xbf,0x16,0x8a,0x98,0x2c,0x6b,0x45,0x7c,0x7f,0x56};
    static std::uint8_t c34[32] = {0x57,0x82,0xb2,0x97,0x9c,0xc8,0x05,0x7f,0x9a,0x53,0xe8,0x10,0x58,0x4b,0x43,0x70,0x03,0xc9,0x6a,0x57,0x49,0x8e,0x12,0x7c,0xe0,0xdb,0x8c,0xd5,0x3c,0xb9,0x80,0xb2};
    sm9_fn_from_bytes(a, a34);
    sm9_fn_from_bytes(b, b34);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c34, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a35[32] = {0x0c,0xf1,0xef,0xaa,0x88,0x20,0xf4,0xb1,0xba,0x2b,0x31,0x13,0xc4,0xb2,0x21,0xf9,0xc7,0x74,0x4d,0x3b,0x88,0x35,0xec,0xc3,0xc1,0xf4,0x21,0xf4,0xee,0x14,0x0c,0x31};
    static std::uint8_t b35[32] = {0x8c,0x19,0xa1,0x30,0xd7,0x2d,0xf2,0x03,0xec,0x8f,0x41,0xe8,0x0e,0x7f,0x28,0x30,0x2f,0xba,0xc7,0xc2,0xc8,0x17,0x34,0x8a,0x80,0xcf,0xf4,0x2d,0x52,0x47,0x3d,0x60};
    static std::uint8_t c35[32] = {0x37,0x18,0x4e,0x79,0xb3,0x96,0xa9,0x9f,0xa3,0x9f,0x9a,0x7b,0xab,0xc1,0xc1,0x0d,0xe1,0xac,0x18,0xc3,0xd9,0x09,0x44,0x28,0x26,0x93,0x0f,0x64,0x72,0x6b,0x9d,0xf6};
    sm9_fn_from_bytes(a, a35);
    sm9_fn_from_bytes(b, b35);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c35, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a36[32] = {0x08,0x7a,0xc3,0x5a,0x73,0xeb,0x08,0xae,0xdb,0x8a,0x93,0xac,0xb1,0x7f,0xbf,0xb2,0xb7,0xaa,0x70,0xe0,0xec,0x82,0x42,0x3e,0x41,0x9f,0x2f,0x27,0x29,0x6b,0xb0,0x22};
    static std::uint8_t b36[32] = {0xa5,0xbe,0x0a,0x80,0x18,0xa8,0x51,0xa3,0x4c,0x4b,0xd5,0x72,0xff,0xe6,0x93,0xeb,0xc1,0xd6,0x7a,0xc5,0x84,0xc7,0x01,0x1f,0x5b,0x39,0xe5,0xe5,0x73,0xab,0xdd,0x7e};
    static std::uint8_t c36[32] = {0x18,0xfc,0xb8,0xda,0x5d,0xe6,0x5d,0xfd,0x65,0x42,0x69,0x89,0xa7,0x27,0xf3,0x0b,0x3f,0xc6,0x89,0x66,0x80,0xa5,0xcd,0x0d,0xcb,0xd4,0x2a,0xde,0x8c,0x5e,0xa1,0xc9};
    sm9_fn_from_bytes(a, a36);
    sm9_fn_from_bytes(b, b36);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c36, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a37[32] = {0x7c,0x77,0xea,0x96,0xb0,0xb6,0xd2,0x19,0x69,0xe1,0xbe,0xa2,0x28,0x5a,0xb0,0xcf,0xae,0x2b,0xc0,0xc2,0x2a,0xf0,0x62,0x68,0xf9,0xcc,0xef,0x6f,0x5f,0x5f,0xbc,0x13};
    static std::uint8_t b37[32] = {0x47,0xbe,0x7c,0xf1,0x29,0xd0,0x0e,0xf2,0xec,0xf2,0x8a,0x81,0xfe,0xc3,0xe9,0x5a,0xc5,0x5e,0x03,0x05,0xbd,0x2c,0xf4,0xd0,0x66,0xc8,0x6c,0x99,0xc8,0x31,0x55,0xab};
    static std::uint8_t c37[32] = {0x34,0xb9,0x6d,0xa5,0x86,0xe6,0xc3,0x26,0x7c,0xef,0x34,0x20,0x29,0x96,0xc7,0x74,0xe8,0xcd,0xbd,0xbc,0x6d,0xc3,0x6d,0x98,0x93,0x04,0x82,0xd5,0x97,0x2e,0x66,0x68};
    sm9_fn_from_bytes(a, a37);
    sm9_fn_from_bytes(b, b37);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c37, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a38[32] = {0x2f,0xd3,0x09,0x18,0x68,0x97,0x6d,0xa0,0xb1,0x79,0x0b,0xb3,0xc9,0x1c,0xbb,0xec,0xf9,0xb3,0x8b,0x15,0x68,0xda,0xe3,0x8c,0x61,0xaa,0xd2,0x39,0x2a,0xfe,0xe5,0x6f};
    static std::uint8_t b38[32] = {0x0d,0xc6,0x74,0xb3,0x1a,0x3c,0x8e,0x73,0x42,0xa7,0xe1,0xb7,0x11,0xb5,0xd4,0x05,0x01,0x9a,0x06,0x5b,0x11,0x2e,0x60,0x31,0x67,0xcd,0xf6,0x11,0x49,0x8b,0x48,0xec};
    static std::uint8_t c38[32] = {0x22,0x0c,0x94,0x65,0x4e,0x5a,0xdf,0x2d,0x6e,0xd1,0x29,0xfc,0xb7,0x66,0xe7,0xe7,0xf8,0x19,0x84,0xba,0x57,0xac,0x83,0x5a,0xf9,0xdc,0xdc,0x27,0xe1,0x73,0x9c,0x83};
    sm9_fn_from_bytes(a, a38);
    sm9_fn_from_bytes(b, b38);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c38, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a39[32] = {0x52,0x2f,0x8a,0x6f,0x2b,0xc7,0xba,0x85,0xcf,0x01,0x29,0xbe,0x2b,0x03,0xa6,0x5b,0x03,0x34,0xd8,0xec,0xcf,0x55,0x68,0xed,0x83,0x6b,0x5a,0x07,0x02,0x59,0xc4,0xe6};
    static std::uint8_t b39[32] = {0x16,0x18,0x44,0x5b,0xe9,0x94,0x70,0xdb,0x4a,0x19,0xb8,0x3b,0xdf,0x2f,0x58,0x5e,0x1e,0xe9,0x52,0xaa,0x97,0x72,0x98,0xad,0x04,0x39,0x4c,0x31,0xef,0x08,0x36,0x63};
    static std::uint8_t c39[32] = {0x3c,0x17,0x46,0x13,0x42,0x33,0x49,0xaa,0x84,0xe7,0x71,0x82,0x4b,0xd4,0x4d,0xfc,0xe4,0x4b,0x86,0x42,0x37,0xe2,0xd0,0x40,0x7f,0x32,0x0d,0xd5,0x13,0x51,0x8e,0x83};
    sm9_fn_from_bytes(a, a39);
    sm9_fn_from_bytes(b, b39);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c39, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a40[32] = {0x92,0xa7,0x64,0x33,0x34,0xfe,0x23,0xa5,0x38,0x54,0x32,0x03,0xef,0xa8,0x40,0x71,0xe1,0x3f,0x67,0xa4,0xe2,0x24,0xba,0x64,0xe5,0x37,0x1f,0xd3,0xb6,0x34,0xbf,0xc0};
    static std::uint8_t b40[32] = {0xa7,0x43,0x42,0x31,0xc3,0xe6,0xc1,0xcf,0xed,0x16,0x1b,0x56,0x04,0x9f,0x85,0x95,0xd5,0xa5,0xa7,0x2e,0x1b,0x49,0xe1,0x27,0x9b,0x97,0x96,0x18,0x5a,0x3a,0xd9,0x95};
    static std::uint8_t c40[32] = {0xa1,0xa4,0x22,0x01,0x73,0xbb,0x08,0xc7,0x21,0x41,0xc1,0xfd,0xe0,0x97,0x82,0x20,0x55,0x8c,0x53,0xc1,0xdf,0xc5,0x65,0x2c,0x2f,0x0e,0x6b,0x58,0x32,0x98,0xb5,0x50};
    sm9_fn_from_bytes(a, a40);
    sm9_fn_from_bytes(b, b40);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c40, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a41[32] = {0x3d,0xc8,0x13,0x41,0x86,0x2d,0x97,0x40,0x0b,0x23,0xcb,0x5f,0x4c,0xb4,0xc2,0x3c,0xd4,0x1e,0xb2,0x0f,0x83,0xbc,0xd1,0x5c,0x56,0x7f,0x38,0x0c,0xb7,0x7a,0xf4,0x09};
    static std::uint8_t b41[32] = {0x42,0xa7,0xb6,0xb9,0x7e,0x08,0x82,0xd7,0xb9,0x59,0xc2,0xee,0x0b,0xcb,0x09,0x1a,0x1a,0x81,0x04,0x39,0xc5,0xad,0x3a,0x17,0x4f,0xe0,0xc3,0x96,0x00,0x3c,0x2e,0x31};
    static std::uint8_t c41[32] = {0xb1,0x60,0x5c,0x88,0x0a,0xc8,0xbb,0x5a,0x27,0xcd,0xb3,0xc1,0x36,0x78,0x80,0x67,0x03,0x90,0x41,0x20,0xd6,0xfa,0x23,0x33,0xec,0x0d,0x56,0x13,0x8d,0xdd,0x94,0xfd};
    sm9_fn_from_bytes(a, a41);
    sm9_fn_from_bytes(b, b41);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c41, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a42[32] = {0xad,0x8d,0xf7,0x78,0x99,0xa6,0x93,0x5e,0xeb,0xb6,0x71,0xa7,0xea,0x29,0x4f,0xdb,0xbe,0x5c,0x1f,0x19,0x4f,0x7e,0xcd,0xbc,0x63,0x1b,0x3a,0xbb,0x04,0xca,0x06,0xfc};
    static std::uint8_t b42[32] = {0x9f,0xa5,0x4c,0xe2,0x4c,0x96,0x09,0x1c,0x24,0xf6,0x8c,0x72,0xa4,0x77,0xeb,0x4c,0x42,0x43,0x58,0xe1,0x2e,0x3b,0x26,0xa0,0x27,0x99,0x80,0x22,0xa1,0xfd,0xcf,0x2f};
    static std::uint8_t c42[32] = {0x0d,0xe8,0xaa,0x96,0x4d,0x10,0x8a,0x42,0xc6,0xbf,0xe5,0x35,0x45,0xb1,0x64,0x8f,0x7c,0x18,0xc6,0x38,0x21,0x43,0xa7,0x1c,0x3b,0x81,0xba,0x98,0x62,0xcc,0x37,0xcd};
    sm9_fn_from_bytes(a, a42);
    sm9_fn_from_bytes(b, b42);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c42, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a43[32] = {0x72,0xd9,0xd5,0xe0,0xb8,0x5f,0xfa,0x14,0xd5,0xec,0x9c,0x62,0x58,0x99,0xf9,0xc7,0x9a,0xad,0x4e,0x6a,0xa7,0xff,0x7f,0xf3,0x15,0x75,0xee,0xd0,0x78,0xbe,0x49,0xf3};
    static std::uint8_t b43[32] = {0x6e,0x41,0xb8,0xeb,0xc0,0xf6,0xf3,0x83,0x1a,0xaf,0x33,0x1e,0x91,0x45,0xf9,0x07,0x63,0x68,0x87,0x37,0x80,0x98,0x7d,0x9d,0x76,0x6b,0x7a,0x9f,0x56,0x61,0xab,0x36};
    static std::uint8_t c43[32] = {0x04,0x98,0x1c,0xf4,0xf7,0x69,0x06,0x91,0xbb,0x3d,0x69,0x43,0xc7,0x54,0x00,0xc0,0x37,0x44,0xc7,0x33,0x27,0x67,0x02,0x55,0x9f,0x0a,0x74,0x31,0x22,0x5c,0x9e,0xbd};
    sm9_fn_from_bytes(a, a43);
    sm9_fn_from_bytes(b, b43);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c43, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a44[32] = {0x41,0x41,0xf9,0xd6,0x3e,0x72,0xf3,0xbd,0xab,0xc0,0x5e,0xad,0xf1,0x4b,0xbf,0x96,0xed,0x94,0xcd,0x49,0x9c,0x29,0x8d,0xcf,0x45,0x04,0x5c,0x61,0x83,0xc8,0x04,0x45};
    static std::uint8_t b44[32] = {0x44,0x92,0x86,0xf1,0x52,0xc2,0x94,0x2a,0xf1,0x20,0x83,0xa2,0x71,0xdf,0x76,0x7d,0xa8,0x49,0x71,0x5c,0x86,0xbf,0x51,0x6b,0xf2,0x2e,0xa2,0xb8,0xe2,0xad,0xa1,0xdf};
    static std::uint8_t c44[32] = {0xb2,0xef,0x72,0xe4,0xee,0x54,0x06,0x84,0x90,0xa3,0x86,0x5b,0x74,0xfb,0x10,0x5d,0x8f,0x3d,0xef,0x38,0x2e,0x54,0xc8,0x52,0x38,0x44,0x9b,0x45,0x77,0xb9,0x31,0x8b};
    sm9_fn_from_bytes(a, a44);
    sm9_fn_from_bytes(b, b44);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c44, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a45[32] = {0xb1,0x16,0x8d,0x2b,0xf0,0xa3,0x01,0x56,0x11,0x68,0x0b,0xaf,0x24,0x8e,0x10,0x36,0x59,0x69,0xd2,0xa0,0x42,0xa0,0xce,0x9b,0x14,0x5b,0x06,0x84,0x01,0x48,0x6e,0x13};
    static std::uint8_t b45[32] = {0x3e,0x64,0xf9,0x02,0xc0,0x91,0x0b,0x90,0x1b,0x7d,0xf8,0xd6,0x86,0x19,0x85,0xae,0x9f,0x38,0x91,0xf6,0x4a,0x76,0xf0,0x70,0x2c,0x9f,0x49,0xf4,0x63,0xc7,0xb7,0x5e};
    static std::uint8_t c45[32] = {0x72,0xb1,0x94,0x29,0x30,0x11,0xf5,0xc5,0xf5,0xea,0x12,0xd8,0x9e,0x74,0x8a,0x87,0xba,0x31,0x40,0xa9,0xf8,0x29,0xde,0x2a,0xe7,0xbb,0xbc,0x8f,0x9d,0x80,0xb6,0xb5};
    sm9_fn_from_bytes(a, a45);
    sm9_fn_from_bytes(b, b45);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c45, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a46[32] = {0x59,0x08,0x7f,0x19,0xba,0xdb,0xad,0x16,0xdc,0xe4,0x39,0x06,0x35,0x94,0xce,0x38,0x70,0xb9,0x31,0xcb,0x10,0x34,0xb4,0xe7,0x99,0xa9,0xd7,0x47,0x7c,0xc4,0xeb,0x9f};
    static std::uint8_t b46[32] = {0xa8,0xa1,0xa7,0x87,0x96,0x40,0x5e,0x48,0xd2,0x07,0x72,0x48,0x5d,0x61,0x96,0x8f,0x14,0xa5,0xb0,0x55,0x0e,0xc9,0x83,0x7c,0x6d,0xa3,0x61,0xda,0xd0,0x54,0x0d,0x4b};
    static std::uint8_t c46[32] = {0x66,0xa6,0xd7,0x92,0x27,0x3e,0xf5,0xbf,0xe0,0xe0,0x72,0x0d,0xcd,0xc1,0xfe,0xed,0xa6,0x06,0x14,0xc1,0x1a,0x55,0xbd,0x5a,0x11,0x75,0x57,0x09,0x83,0x0f,0xad,0x79};
    sm9_fn_from_bytes(a, a46);
    sm9_fn_from_bytes(b, b46);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c46, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a47[32] = {0x18,0xaf,0x71,0x97,0x1c,0x56,0xce,0xd8,0xd4,0xf4,0xdc,0x42,0xee,0x2d,0x23,0x00,0xda,0x7f,0xf8,0x40,0x9a,0x18,0xe3,0x0c,0x80,0x71,0xfb,0xef,0xa0,0x55,0xf6,0x5c};
    static std::uint8_t b47[32] = {0x20,0x0b,0xd9,0x8b,0xd7,0x05,0x09,0x22,0xde,0xff,0xdf,0x11,0x7b,0x22,0x7c,0x39,0x35,0x03,0x53,0xa8,0x47,0x92,0x86,0x5b,0x28,0x9e,0x2f,0x3a,0x73,0x72,0x67,0x0c};
    static std::uint8_t c47[32] = {0xae,0xe3,0x98,0x0b,0x47,0xf5,0x6c,0xa7,0xcb,0xf8,0xa8,0x81,0x68,0x99,0x6e,0x0b,0xef,0x6f,0x37,0xe3,0x6b,0x70,0xe8,0xa0,0x3d,0x42,0xae,0x52,0x03,0x82,0x5e,0x75};
    sm9_fn_from_bytes(a, a47);
    sm9_fn_from_bytes(b, b47);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c47, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a48[32] = {0x7a,0x86,0xc4,0xb4,0xc3,0x85,0xc1,0xf9,0x76,0x1d,0x99,0x58,0x35,0x3f,0x77,0x0d,0xa2,0xed,0x81,0x57,0x2e,0x10,0x4a,0x42,0x4a,0x23,0xa5,0x2e,0x89,0xa0,0x7e,0x9d};
    static std::uint8_t b48[32] = {0x43,0x06,0x9e,0x18,0x1d,0xcc,0x0d,0x23,0x3f,0x65,0xfc,0x41,0xff,0xbc,0x4b,0xb5,0x03,0xbe,0xe5,0xab,0xa4,0x71,0xd4,0x9c,0xe3,0xd5,0xf5,0x28,0x9a,0x1c,0x04,0x44};
    static std::uint8_t c48[32] = {0x37,0x80,0x26,0x9c,0xa5,0xb9,0xb4,0xd6,0x36,0xb7,0x9d,0x16,0x35,0x83,0x2b,0x58,0x9f,0x2e,0x9b,0xab,0x89,0x9e,0x75,0xa5,0x66,0x4d,0xb0,0x05,0xef,0x84,0x7a,0x59};
    sm9_fn_from_bytes(a, a48);
    sm9_fn_from_bytes(b, b48);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c48, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a49[32] = {0x72,0xa7,0x52,0x94,0x94,0x85,0xd1,0xbe,0xc0,0x6e,0xcc,0x13,0x70,0x72,0x8d,0xf0,0x98,0x15,0x9a,0xfa,0x29,0xe5,0x2e,0x33,0x33,0x24,0x27,0x05,0xa3,0x80,0x04,0xb7};
    static std::uint8_t b49[32] = {0x51,0xbf,0x7b,0x07,0x6c,0x1e,0xa3,0xd2,0x4b,0x6a,0xca,0x79,0x13,0x25,0xd1,0x84,0x84,0xaf,0x6e,0xee,0xfb,0xa8,0xe3,0xa6,0x97,0x2e,0x95,0x70,0xe6,0xe0,0x91,0x1d};
    static std::uint8_t c49[32] = {0x20,0xe7,0xd7,0x8d,0x28,0x67,0x2d,0xec,0x75,0x04,0x01,0x9a,0x5d,0x4c,0xbc,0x6c,0x13,0x66,0x2c,0x0b,0x2e,0x3c,0x4a,0x8c,0x9b,0xf5,0x91,0x94,0xbc,0x9f,0x73,0x9a};
    sm9_fn_from_bytes(a, a49);
    sm9_fn_from_bytes(b, b49);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c49, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a50[32] = {0x99,0x6a,0xbe,0x64,0xe6,0x0b,0xd7,0xf4,0xc1,0x09,0x11,0x0e,0x35,0x5c,0xe9,0x3b,0x2e,0x7f,0x4b,0x23,0x70,0xc0,0xad,0x7f,0x70,0x85,0x2a,0x4a,0xc8,0xc4,0xe4,0x2e};
    static std::uint8_t b50[32] = {0x71,0x6c,0x6e,0x4c,0x4f,0xa8,0xf1,0x86,0xd9,0xba,0x20,0x90,0xd7,0x27,0x8c,0x69,0xbb,0xd0,0x8a,0x2a,0xce,0x33,0xd0,0x12,0x11,0x58,0xe3,0x13,0x6e,0xe3,0x71,0xcf};
    static std::uint8_t c50[32] = {0x27,0xfe,0x50,0x18,0x96,0x62,0xe6,0x6d,0xe7,0x4e,0xf0,0x7d,0x5e,0x35,0x5c,0xd1,0x72,0xae,0xc0,0xf8,0xa2,0x8c,0xdd,0x6d,0x5f,0x2c,0x47,0x37,0x59,0xe1,0x72,0x5f};
    sm9_fn_from_bytes(a, a50);
    sm9_fn_from_bytes(b, b50);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c50, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a51[32] = {0x3e,0x4f,0x40,0xe7,0x6c,0x78,0xb5,0x61,0xff,0xc9,0x3b,0x2c,0xef,0x1d,0x18,0x9e,0xd1,0x23,0x06,0xb6,0x2f,0xff,0x18,0xa4,0x34,0x78,0x35,0xed,0x2d,0x8e,0x97,0x39};
    static std::uint8_t b51[32] = {0x31,0x4e,0x33,0x51,0xd3,0x3e,0x00,0x34,0xd5,0x5d,0xa2,0xf6,0xa4,0xb2,0xf5,0x39,0x24,0x72,0x2e,0x35,0xa4,0x9f,0x92,0xa3,0xfd,0x0a,0x0c,0xaf,0x5c,0x18,0x82,0xe7};
    static std::uint8_t c51[32] = {0x0d,0x01,0x0d,0x95,0x99,0x3a,0xb5,0x2d,0x2a,0x6b,0x98,0x36,0x4a,0x6a,0x23,0x65,0xac,0xb0,0xd8,0x80,0x8b,0x5f,0x86,0x00,0x37,0x6e,0x29,0x3d,0xd1,0x76,0x14,0x52};
    sm9_fn_from_bytes(a, a51);
    sm9_fn_from_bytes(b, b51);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c51, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a52[32] = {0x08,0xe6,0x22,0x7f,0x94,0x81,0xb4,0xf4,0x3a,0x63,0xff,0x6c,0xf6,0x01,0xc1,0xb4,0xb1,0xc2,0x99,0x41,0x5b,0x03,0xb2,0xed,0x53,0x91,0x30,0x75,0xbb,0xb1,0xae,0xa7};
    static std::uint8_t b52[32] = {0x1c,0x3e,0xf9,0x45,0x17,0xea,0x6a,0x48,0xec,0x80,0xc9,0x43,0x70,0xac,0x08,0xb6,0xae,0xbd,0xa9,0x98,0x10,0xcb,0x3a,0xcd,0x86,0x51,0x0c,0x8d,0x9e,0x0b,0x51,0x44};
    static std::uint8_t c52[32] = {0xa2,0xe7,0x29,0x3a,0x7f,0x3a,0xf1,0x9d,0x23,0xe6,0xe1,0x79,0x7a,0xe4,0x80,0x42,0x4c,0xf7,0x82,0xf4,0x63,0x23,0x04,0x0e,0xb2,0xaf,0x05,0x84,0xf4,0x45,0x2c,0x88};
    sm9_fn_from_bytes(a, a52);
    sm9_fn_from_bytes(b, b52);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c52, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a53[32] = {0x75,0x92,0xd6,0x53,0x39,0x7c,0x8b,0xcc,0xa5,0x28,0x42,0xf8,0xde,0x71,0xee,0x8e,0x0a,0x75,0xa8,0x89,0x8e,0x07,0x20,0x1b,0x52,0x6f,0x3f,0x1c,0x6c,0x3f,0x98,0x5a};
    static std::uint8_t b53[32] = {0x36,0x7a,0xe6,0x7a,0xd3,0x2b,0x4a,0x12,0xd6,0x17,0xbe,0x42,0x8c,0xbc,0x69,0xbd,0xf0,0x6a,0xbf,0x1f,0x11,0xc3,0x02,0x0a,0xa7,0xca,0xdc,0xf9,0xc3,0x7a,0x8b,0xb0};
    static std::uint8_t c53[32] = {0x3f,0x17,0xef,0xd8,0x66,0x51,0x41,0xb9,0xcf,0x10,0x84,0xb6,0x51,0xb5,0x84,0xd0,0x1a,0x0a,0xe9,0x6a,0x7c,0x44,0x1e,0x10,0xaa,0xa4,0x62,0x22,0xa8,0xc5,0x0c,0xaa};
    sm9_fn_from_bytes(a, a53);
    sm9_fn_from_bytes(b, b53);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c53, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a54[32] = {0x9a,0xc9,0x41,0xf4,0xc4,0x3b,0xcd,0x9e,0x32,0xae,0x37,0xd0,0x2a,0xf7,0x7c,0x6a,0xc1,0xa2,0x29,0x54,0x33,0x34,0xc1,0xd1,0xb2,0xca,0x29,0xf7,0x0c,0x05,0x42,0x3a};
    static std::uint8_t b54[32] = {0x9e,0x15,0x0a,0x7b,0x18,0x82,0xad,0xa3,0x93,0xcb,0xaf,0xd8,0x0d,0x82,0x0f,0x59,0xb4,0x70,0x65,0xa8,0xb3,0x4d,0xef,0xf7,0xfe,0xb6,0x81,0x09,0xe5,0x51,0x92,0xaf};
    static std::uint8_t c54[32] = {0xb2,0xf4,0x37,0x79,0xae,0x5c,0xc6,0xec,0x74,0xe6,0x33,0x48,0x13,0x04,0x34,0x55,0x57,0x24,0x56,0xf6,0x98,0xd1,0x5d,0xc8,0x99,0x82,0x8a,0x89,0xfd,0x52,0x7e,0xb0};
    sm9_fn_from_bytes(a, a54);
    sm9_fn_from_bytes(b, b54);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c54, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a55[32] = {0x30,0xb9,0xe5,0xaf,0xf3,0x3c,0x97,0xc5,0x1e,0x3d,0x23,0x30,0x7e,0x60,0x6f,0xb9,0x0e,0x76,0x4e,0x57,0x29,0x40,0x82,0x37,0x28,0x93,0xb1,0x85,0x6e,0xb4,0x1f,0x4b};
    static std::uint8_t b55[32] = {0x57,0x02,0x21,0x47,0x5b,0x81,0x1a,0xd6,0xf2,0x3d,0xc2,0x6f,0x12,0x35,0xcc,0xe8,0x94,0x02,0xc9,0x1a,0x2d,0xec,0x04,0x82,0xe7,0x65,0x68,0x98,0x6d,0x1d,0x3b,0xd5};
    static std::uint8_t c55[32] = {0x8f,0xf7,0xc4,0x68,0x9a,0x5f,0x23,0xe0,0x02,0x03,0x0c,0x11,0x61,0xb9,0x6a,0x14,0xc4,0x66,0x18,0x88,0x14,0x3f,0x09,0xa3,0x26,0x9d,0x2a,0x89,0xd8,0x35,0xb2,0x9b};
    sm9_fn_from_bytes(a, a55);
    sm9_fn_from_bytes(b, b55);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c55, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a56[32] = {0x40,0x95,0x3c,0x3e,0xc8,0xeb,0xf1,0x95,0xfd,0x88,0x44,0x1f,0x36,0x58,0x4b,0x68,0x04,0xde,0xfc,0x03,0x70,0xfd,0x51,0xf9,0x38,0xbd,0xa4,0xca,0xeb,0xab,0x1b,0x75};
    static std::uint8_t b56[32] = {0x86,0x1f,0xc2,0xd8,0x65,0x43,0x26,0xba,0xe0,0xf4,0x00,0x2a,0x14,0x61,0x8f,0x14,0x72,0xb9,0xf5,0x78,0x08,0xbd,0x20,0x46,0x02,0xc0,0xe9,0x0b,0xbf,0x5b,0xc2,0x46};
    static std::uint8_t c56[32] = {0x70,0xb5,0x79,0x66,0x66,0x4c,0x71,0xcc,0xf2,0x97,0xef,0x45,0x17,0x85,0x83,0x97,0xdc,0x17,0x99,0xd6,0x81,0x2a,0xbd,0xa2,0x1b,0x6b,0x9d,0x5c,0x02,0xee,0x28,0x54};
    sm9_fn_from_bytes(a, a56);
    sm9_fn_from_bytes(b, b56);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c56, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a57[32] = {0x77,0xf9,0x21,0x73,0x7b,0x01,0x8a,0x95,0xc5,0x9d,0x61,0x2f,0xd1,0x61,0x90,0x87,0x99,0xa0,0x1a,0xee,0x99,0xec,0x34,0x7b,0x8e,0x1c,0x40,0xac,0x5b,0xb3,0xd2,0x6a};
    static std::uint8_t b57[32] = {0x50,0x4f,0x76,0x81,0x74,0x5e,0x75,0xd7,0x04,0x8b,0x07,0xdd,0xd2,0x51,0x65,0x62,0xc0,0xbe,0xc0,0x0f,0x0b,0xee,0x1b,0xa7,0xc0,0x9c,0x92,0x40,0x50,0xf5,0x56,0xa7};
    static std::uint8_t c57[32] = {0x27,0xa9,0xaa,0xf2,0x06,0xa3,0x14,0xbe,0xc1,0x12,0x59,0x51,0xff,0x10,0x2b,0x24,0xd8,0xe1,0x5a,0xdf,0x8d,0xfe,0x18,0xd3,0xcd,0x7f,0xae,0x6c,0x0a,0xbe,0x7b,0xc3};
    sm9_fn_from_bytes(a, a57);
    sm9_fn_from_bytes(b, b57);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c57, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a58[32] = {0xa8,0x97,0x65,0x9c,0x9a,0xfd,0x1e,0x01,0x64,0x6a,0x13,0xd6,0x54,0xcf,0x82,0x60,0x22,0x18,0xf1,0xc5,0x90,0x27,0xd3,0xd4,0x18,0xe3,0x4b,0x32,0xd9,0xeb,0xf8,0x93};
    static std::uint8_t b58[32] = {0x3f,0x40,0x82,0x49,0x03,0x50,0x01,0xae,0x0b,0xc5,0x92,0xf2,0xfe,0xf8,0x99,0xe6,0x5e,0x62,0xfa,0xf8,0xa9,0x82,0xe0,0xc8,0x3d,0x5c,0x4e,0x3e,0x67,0xdd,0xd6,0xd3};
    static std::uint8_t c58[32] = {0x69,0x56,0xe3,0x53,0x97,0xad,0x1c,0x53,0x58,0xa4,0x80,0xe3,0x55,0xd6,0xe8,0x79,0xc3,0xb5,0xf6,0xcc,0xe6,0xa4,0xf3,0x0b,0xdb,0x86,0xfc,0xf4,0x72,0x0e,0x21,0xc0};
    sm9_fn_from_bytes(a, a58);
    sm9_fn_from_bytes(b, b58);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c58, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a59[32] = {0x2b,0x2d,0x03,0x99,0x4e,0xba,0xb2,0x3a,0x9a,0x80,0x40,0x2f,0xc4,0x89,0xfa,0x5e,0xa1,0xa6,0x91,0xe4,0x2c,0x83,0x93,0xdc,0xb0,0xd4,0xd1,0xb6,0x0c,0x45,0xa0,0x3a};
    static std::uint8_t b59[32] = {0x1d,0xec,0x81,0x66,0x78,0xb6,0x82,0xc7,0x9d,0x76,0x8d,0x1c,0xbc,0xf9,0x95,0xd2,0xd3,0x4a,0x24,0x09,0x81,0xb6,0xb5,0x48,0xfc,0xed,0xc3,0xa0,0xcc,0x18,0x2b,0xe5};
    static std::uint8_t c59[32] = {0x0d,0x40,0x82,0x32,0xd6,0x04,0x2f,0x72,0xfd,0x09,0xb3,0x13,0x07,0x90,0x64,0x8b,0xce,0x5c,0x6d,0xda,0xaa,0xcc,0xde,0x93,0xb3,0xe7,0x0e,0x15,0x40,0x2d,0x74,0x55};
    sm9_fn_from_bytes(a, a59);
    sm9_fn_from_bytes(b, b59);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c59, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a60[32] = {0x6c,0x8c,0xcd,0x22,0xdb,0x7b,0xb0,0x16,0xb1,0x28,0x3c,0x32,0xd6,0xab,0xa7,0xd4,0x51,0x5d,0x00,0xbb,0x2d,0xbe,0x76,0xf9,0xd9,0x3d,0x38,0xeb,0x6a,0xfd,0xf8,0xf4};
    static std::uint8_t b60[32] = {0x0b,0x4f,0xb8,0x17,0x01,0x22,0x0b,0x56,0xf8,0x71,0x98,0xbe,0xb8,0xfb,0x71,0x7e,0x14,0x96,0x72,0xf9,0x26,0x11,0x7a,0x92,0x7e,0xb9,0xdd,0x2f,0x7e,0xfa,0xeb,0x7a};
    static std::uint8_t c60[32] = {0x61,0x3d,0x15,0x0b,0xda,0x59,0xa4,0xbf,0xb8,0xb6,0xa3,0x74,0x1d,0xb0,0x36,0x56,0x3c,0xc6,0x8d,0xc2,0x07,0xac,0xfc,0x67,0x5a,0x83,0x5b,0xbb,0xec,0x03,0x0d,0x7a};
    sm9_fn_from_bytes(a, a60);
    sm9_fn_from_bytes(b, b60);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c60, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a61[32] = {0x38,0xfb,0x78,0x1f,0x62,0x97,0x7d,0xe1,0x47,0x9a,0x3f,0x0c,0xa3,0xc4,0xa7,0xe4,0xbb,0x7f,0x22,0x36,0xd6,0x17,0x02,0x3b,0x46,0x69,0xc8,0xd3,0xaa,0xc7,0x06,0x55};
    static std::uint8_t b61[32] = {0x4c,0x3c,0x0e,0x39,0xc4,0xc4,0x9e,0x69,0xbf,0x28,0x74,0x1c,0x25,0x82,0x90,0xa2,0xc2,0xa1,0x16,0x26,0xfb,0x48,0x92,0xdb,0x84,0x46,0xce,0xca,0x47,0x5f,0x46,0xe8};
    static std::uint8_t c61[32] = {0xa2,0xff,0x69,0xe5,0xa0,0x76,0x86,0x69,0x5e,0x75,0x76,0x40,0x73,0xd0,0xde,0x86,0x42,0xd0,0x9f,0x5a,0xf3,0xb8,0xfb,0x4e,0xa7,0x91,0xdb,0xa6,0x3a,0x06,0x8e,0x92};
    sm9_fn_from_bytes(a, a61);
    sm9_fn_from_bytes(b, b61);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c61, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a62[32] = {0x88,0x7f,0x4d,0x5f,0xe2,0x01,0x63,0x1d,0xfe,0x76,0x63,0x4b,0x40,0x55,0xd3,0x8c,0x8b,0x2f,0x0d,0xb3,0x56,0xcd,0x60,0x8b,0x46,0x1c,0x82,0x64,0xec,0x96,0x59,0x93};
    static std::uint8_t b62[32] = {0x03,0x2e,0x84,0x8f,0x5f,0xb6,0xab,0x36,0x9e,0x83,0x1d,0x02,0xd4,0xcd,0xe7,0x7c,0xd4,0xb1,0x30,0x51,0xd4,0x4f,0x54,0x3a,0x07,0xe9,0xa2,0xec,0x37,0x4a,0x7c,0x53};
    static std::uint8_t c62[32] = {0x85,0x50,0xc8,0xd0,0x82,0x4a,0xb7,0xe7,0x5f,0xf3,0x46,0x48,0x6b,0x87,0xec,0x0f,0xb6,0x7d,0xdd,0x61,0x82,0x7e,0x0c,0x51,0x3e,0x32,0xdf,0x78,0xb5,0x4b,0xdd,0x40};
    sm9_fn_from_bytes(a, a62);
    sm9_fn_from_bytes(b, b62);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c62, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a63[32] = {0x39,0x1e,0x7e,0x55,0xa2,0x63,0x9e,0xa2,0x43,0x21,0x81,0x8a,0xa6,0x91,0x21,0xda,0x69,0x52,0x5d,0xa3,0xf4,0xa0,0x8e,0x41,0xd4,0x38,0x2d,0xa6,0x8e,0x55,0x79,0x72};
    static std::uint8_t b63[32] = {0x11,0x48,0xac,0xd0,0x01,0x51,0x0a,0x0a,0x06,0xc6,0x15,0x3d,0x0b,0x3b,0x81,0xdb,0x66,0x7b,0x5b,0x19,0xc0,0xf9,0x8a,0x93,0xbb,0x7b,0x88,0xbe,0x7e,0xf7,0x3a,0x91};
    static std::uint8_t c63[32] = {0x27,0xd5,0xd1,0x85,0xa1,0x12,0x94,0x98,0x3c,0x5b,0x6c,0x4d,0x9b,0x55,0x9f,0xff,0x02,0xd7,0x02,0x8a,0x33,0xa7,0x03,0xae,0x18,0xbc,0xa4,0xe8,0x0f,0x5e,0x3e,0xe1};
    sm9_fn_from_bytes(a, a63);
    sm9_fn_from_bytes(b, b63);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c63, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a64[32] = {0x3d,0x58,0xa8,0xaa,0x80,0xce,0xe2,0x71,0x81,0xb6,0x8e,0x96,0x0c,0x2c,0x75,0x07,0x85,0x3e,0x99,0x6c,0x65,0xcf,0x16,0x32,0x1a,0xd2,0x79,0x69,0x8a,0x08,0xb4,0xcb};
    static std::uint8_t b64[32] = {0x80,0x60,0x6e,0xf0,0x1d,0xf2,0x90,0x13,0xc6,0x86,0xfa,0x0a,0xa7,0xdc,0xcd,0x2c,0x12,0xe7,0x6a,0xd4,0x91,0x4e,0x61,0x06,0x0f,0xe9,0xe4,0x71,0x3a,0x5a,0x18,0x54};
    static std::uint8_t c64[32] = {0x73,0x38,0x39,0xba,0x65,0x7f,0xf9,0x4f,0x91,0x33,0x3f,0xdb,0x59,0xde,0x6f,0x1f,0xbc,0x49,0xc1,0xe2,0xed,0x6b,0x41,0x1a,0xf0,0x57,0x76,0x95,0x26,0x4d,0x6b,0x9c};
    sm9_fn_from_bytes(a, a64);
    sm9_fn_from_bytes(b, b64);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c64, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a65[32] = {0x3c,0x7c,0xf4,0xf4,0xef,0xc2,0x85,0x9d,0x1b,0x4c,0x30,0x1d,0x91,0xf8,0x0c,0x8d,0x25,0x54,0xde,0x31,0x06,0xec,0xbd,0xfa,0x65,0xa3,0xbf,0x7a,0x08,0x24,0x3a,0x8e};
    static std::uint8_t b65[32] = {0x30,0x5a,0xb6,0x33,0xc6,0x51,0xce,0xff,0x1a,0x05,0x95,0x50,0x29,0xc9,0xce,0xa6,0x0d,0xae,0x78,0xb0,0x02,0xa6,0x1c,0xef,0xf9,0x1a,0x44,0x9a,0x59,0x7c,0x4a,0xbc};
    static std::uint8_t c65[32] = {0x0c,0x22,0x3e,0xc1,0x29,0x70,0xb6,0x9e,0x01,0x46,0x9a,0xcd,0x68,0x2e,0x3d,0xe7,0x17,0xa6,0x65,0x81,0x04,0x46,0xa1,0x0a,0x6c,0x89,0x7a,0xdf,0xae,0xa7,0xef,0xd2};
    sm9_fn_from_bytes(a, a65);
    sm9_fn_from_bytes(b, b65);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c65, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a66[32] = {0x4a,0x63,0xac,0x0f,0xd0,0x6b,0xfc,0x99,0x4e,0x67,0x28,0xc3,0x73,0x02,0x35,0x30,0x5e,0x57,0x18,0x7f,0xf5,0xd9,0xa3,0x18,0x84,0xa2,0x23,0xdb,0xc5,0xcd,0x2a,0xc7};
    static std::uint8_t b66[32] = {0x1b,0xbc,0xec,0xd9,0xe6,0xb7,0xad,0xee,0xdf,0x48,0xa1,0x29,0x62,0xa5,0x6b,0xb2,0xcc,0x1e,0x10,0x98,0xcf,0x83,0x61,0x45,0xaa,0xc1,0xa5,0xf7,0xf9,0xaf,0x6c,0x5d};
    static std::uint8_t c66[32] = {0x2e,0xa6,0xbf,0x35,0xe9,0xb4,0x4e,0xaa,0x6f,0x1e,0x87,0x9a,0x10,0x5c,0xc9,0x7d,0x92,0x39,0x07,0xe7,0x26,0x56,0x41,0xd2,0xd9,0xe0,0x7d,0xe3,0xcc,0x1d,0xbe,0x6a};
    sm9_fn_from_bytes(a, a66);
    sm9_fn_from_bytes(b, b66);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c66, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a67[32] = {0x11,0x9b,0xf4,0x6d,0x67,0x14,0x8e,0xc3,0x3b,0x73,0xbc,0x65,0x33,0x29,0xe1,0xb9,0x0e,0xf9,0xf4,0x2a,0x8f,0x63,0x01,0xdf,0xd4,0x91,0x7f,0x34,0x79,0x57,0xe2,0x5f};
    static std::uint8_t b67[32] = {0x07,0x81,0xd2,0x69,0xe7,0xed,0xc2,0x28,0x46,0xce,0x0c,0xd9,0x6e,0xf5,0x7e,0x80,0x50,0x6b,0xbf,0x6e,0x6a,0x78,0xae,0xff,0x54,0x01,0x8b,0x65,0xe7,0x9c,0x97,0x93};
    static std::uint8_t c67[32] = {0x0a,0x1a,0x22,0x03,0x7f,0x26,0xcc,0x9a,0xf4,0xa5,0xaf,0x8b,0xc4,0x34,0x63,0x38,0xbe,0x8e,0x34,0xbc,0x24,0xea,0x52,0xe0,0x80,0x8f,0xf3,0xce,0x91,0xbb,0x4a,0xcc};
    sm9_fn_from_bytes(a, a67);
    sm9_fn_from_bytes(b, b67);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c67, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a68[32] = {0x1a,0xf0,0x34,0x41,0x65,0x20,0x2e,0x99,0x10,0xb8,0xe5,0x90,0xc9,0x63,0x8a,0x97,0xc9,0xfa,0x51,0x5a,0xd6,0xec,0xb5,0xb4,0x6b,0x4c,0x83,0x90,0x7c,0x41,0x82,0x2b};
    static std::uint8_t b68[32] = {0x48,0x45,0xa4,0x11,0x0e,0x4e,0xbc,0xd4,0x75,0x0b,0x14,0xfb,0xb2,0x03,0xf2,0xd1,0x42,0x02,0x10,0x01,0xf9,0x94,0xbe,0x51,0x91,0x39,0x5e,0xc2,0x64,0x54,0x50,0x8f};
    static std::uint8_t c68[32] = {0x88,0xea,0x90,0x30,0x59,0x75,0x18,0xb6,0x71,0xb1,0x7b,0xe5,0x0c,0xee,0x5f,0x0a,0xd1,0xea,0xd4,0xa3,0xf6,0x42,0x83,0x51,0xbf,0x82,0x06,0x6a,0xee,0x8c,0x00,0xc1};
    sm9_fn_from_bytes(a, a68);
    sm9_fn_from_bytes(b, b68);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c68, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a69[32] = {0x1e,0x59,0xdb,0x59,0xe8,0xdd,0x6e,0x70,0xb7,0x7e,0xae,0xdf,0x65,0x40,0x90,0x4a,0x27,0xe9,0xcb,0x5d,0xe6,0x88,0xf6,0xd2,0x1c,0xbc,0xa8,0x55,0xcd,0xf8,0x0a,0xa0};
    static std::uint8_t b69[32] = {0x5a,0x25,0xac,0xcf,0x06,0xce,0x42,0x25,0x7c,0xb8,0x6c,0xbe,0xf1,0x1a,0xa9,0x57,0x40,0xdf,0xeb,0xae,0x2a,0xb7,0xe7,0x73,0xe8,0xdd,0x4d,0x24,0xce,0x94,0xb6,0xf5};
    static std::uint8_t c69[32] = {0x7a,0x74,0x2e,0x8a,0xe4,0xb2,0xd3,0x3d,0x10,0xc9,0xed,0x70,0x69,0xb4,0xae,0x37,0x30,0xfc,0x72,0xfa,0xd4,0xbb,0x9b,0x4d,0x19,0x4e,0x3c,0xcd,0xd6,0x02,0x22,0xd0};
    sm9_fn_from_bytes(a, a69);
    sm9_fn_from_bytes(b, b69);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c69, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a70[32] = {0x23,0x97,0xa2,0x90,0x34,0x77,0x68,0xfa,0x84,0xb9,0xce,0xc1,0xc3,0x80,0x58,0x73,0xb4,0xc0,0xa2,0x2b,0x06,0xe1,0x75,0xee,0x8b,0x5b,0x73,0xee,0x76,0x0e,0x22,0x8b};
    static std::uint8_t b70[32] = {0x0d,0x98,0x43,0xdc,0x55,0x54,0xc0,0xf6,0x05,0xbc,0xb4,0xcc,0x9b,0x21,0x16,0x28,0x7e,0x38,0x60,0xc4,0x6b,0xac,0x94,0xda,0xde,0x01,0xdf,0x5b,0x65,0x52,0xea,0xbc};
    static std::uint8_t c70[32] = {0x15,0xff,0x5e,0xb3,0xdf,0x22,0xa8,0x04,0x7e,0xfd,0x19,0xf5,0x28,0x5f,0x42,0x4b,0x36,0x88,0x41,0x66,0x9b,0x34,0xe1,0x13,0xad,0x59,0x94,0x93,0x10,0xbb,0x37,0xcf};
    sm9_fn_from_bytes(a, a70);
    sm9_fn_from_bytes(b, b70);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c70, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a71[32] = {0x2d,0x81,0xd7,0x15,0xbd,0xdc,0xb0,0xad,0x90,0x5c,0x83,0x23,0x28,0xb0,0xad,0xd0,0x7f,0x2e,0xc8,0x02,0xb1,0x8f,0xd1,0x2a,0x8a,0xe6,0x00,0x7c,0xef,0xca,0xd1,0x80};
    static std::uint8_t b71[32] = {0x40,0x47,0xc5,0x83,0x89,0x36,0x78,0xbf,0x16,0x94,0x4d,0x82,0x59,0x8c,0xd9,0x00,0xce,0x03,0xa7,0x4b,0x01,0x19,0xf6,0x89,0x3b,0x2a,0xce,0x9a,0x33,0x87,0xd3,0x51};
    static std::uint8_t c71[32] = {0xa3,0x7a,0x11,0x92,0x37,0x49,0xde,0xe0,0x4f,0xcb,0xe0,0xf0,0xc4,0xb2,0x9c,0x13,0xfb,0x1d,0xb4,0x02,0xc9,0x60,0x66,0x90,0x35,0x2a,0x13,0x7f,0x92,0xe1,0xcd,0x54};
    sm9_fn_from_bytes(a, a71);
    sm9_fn_from_bytes(b, b71);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c71, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a72[32] = {0x48,0x3d,0x48,0xe8,0x2f,0x72,0xce,0x78,0x46,0x04,0x84,0xbe,0x90,0x00,0xd3,0x82,0xde,0x5e,0x23,0x91,0x03,0xcf,0x46,0xcb,0x1c,0x65,0xc4,0x52,0x86,0xfa,0x3c,0xb2};
    static std::uint8_t b72[32] = {0x84,0x1f,0x73,0x3c,0x70,0xf0,0xf8,0x3a,0xf6,0x90,0x33,0x10,0x3b,0xcb,0x87,0xa9,0xee,0xc7,0xc1,0x06,0x2f,0x9c,0x70,0x61,0x31,0x44,0x50,0x3d,0x26,0x9f,0xd0,0xc5};
    static std::uint8_t c72[32] = {0x7a,0x5d,0xd5,0xab,0xc1,0x25,0x7d,0x2f,0x25,0x77,0xfc,0xfe,0x49,0xc4,0x13,0x1d,0x39,0x88,0xf5,0xd5,0xed,0x1d,0x62,0x58,0xd0,0x90,0x55,0xb2,0x36,0xf9,0x3b,0x12};
    sm9_fn_from_bytes(a, a72);
    sm9_fn_from_bytes(b, b72);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c72, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a73[32] = {0x59,0xe3,0x92,0xda,0xc8,0x10,0x50,0xea,0x88,0x93,0x72,0x81,0xf4,0xa1,0x3b,0xd7,0xa2,0x29,0x38,0x9e,0x25,0x61,0x71,0xec,0xa7,0x95,0x0a,0x32,0x88,0xf4,0x6a,0x8c};
    static std::uint8_t b73[32] = {0x01,0x55,0x07,0x34,0xff,0x82,0x34,0x92,0x43,0x8e,0x68,0xbd,0xc3,0x0c,0x98,0x62,0xf5,0xa4,0x2c,0xbb,0xea,0x42,0x7e,0x2e,0x64,0x9e,0x44,0xec,0x8e,0x89,0xa9,0x01};
    static std::uint8_t c73[32] = {0x58,0x8e,0x8b,0xa5,0xc8,0x8e,0x1c,0x58,0x45,0x05,0x09,0xc4,0x31,0x94,0xa3,0x74,0xac,0x85,0x0b,0xe2,0x3b,0x1e,0xf3,0xbe,0x42,0xf6,0xc5,0x45,0xfa,0x6a,0xc1,0x8b};
    sm9_fn_from_bytes(a, a73);
    sm9_fn_from_bytes(b, b73);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c73, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a74[32] = {0x2d,0x4a,0x8d,0xdd,0x7e,0xf5,0xd3,0x88,0x8e,0x15,0x3b,0xc6,0x32,0xb2,0x96,0xbe,0x2a,0xe1,0xf0,0x9a,0xaf,0x19,0x90,0x64,0x62,0xe0,0x50,0xcb,0x79,0xa3,0x2a,0x78};
    static std::uint8_t b74[32] = {0x22,0x20,0xac,0x35,0x6d,0x1d,0x17,0xce,0x63,0xec,0x04,0xac,0x31,0x73,0x45,0x0e,0xfe,0x89,0x80,0xff,0xbc,0xe1,0x16,0xd9,0x90,0x64,0x31,0x97,0x5a,0x3e,0xcc,0x14};
    static std::uint8_t c74[32] = {0x0b,0x29,0xe1,0xa8,0x11,0xd8,0xbb,0xba,0x2a,0x29,0x37,0x1a,0x01,0x3f,0x51,0xaf,0x2c,0x58,0x6f,0x9a,0xf2,0x38,0x79,0x8a,0xd2,0x7c,0x1f,0x34,0x1f,0x64,0x5e,0x64};
    sm9_fn_from_bytes(a, a74);
    sm9_fn_from_bytes(b, b74);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c74, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a75[32] = {0x2a,0x3b,0xf1,0x53,0xb7,0x29,0x0e,0x3d,0x14,0xa9,0x20,0x6b,0xc6,0x67,0xd5,0x69,0x68,0x76,0xda,0x5e,0xf1,0x4a,0x61,0xfd,0x6e,0x5d,0xfd,0x41,0xaa,0xc5,0x95,0x94};
    static std::uint8_t b75[32] = {0x9d,0xa0,0x49,0x57,0xe9,0xcb,0x99,0x60,0xfd,0x84,0x78,0xfb,0x12,0x0f,0x25,0x69,0x8c,0x01,0x8a,0xe3,0x87,0x8d,0x05,0x8b,0x47,0x07,0x98,0xa5,0xca,0x50,0x80,0xd4};
    static std::uint8_t c75[32] = {0x42,0xdb,0xa7,0xfb,0xd0,0x01,0x1b,0xcd,0xed,0x28,0x52,0xc0,0xa9,0xe7,0x77,0x44,0x26,0x67,0xe2,0xc6,0x82,0xa7,0xe8,0x61,0x0c,0xc5,0x46,0x38,0xb7,0x13,0xe3,0xe5};
    sm9_fn_from_bytes(a, a75);
    sm9_fn_from_bytes(b, b75);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c75, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a76[32] = {0x2e,0xd0,0xd4,0x6b,0x9f,0xbb,0xc2,0x0b,0xe5,0x2c,0xf9,0xf5,0xdf,0x38,0xb9,0xfd,0x6d,0x83,0x54,0x29,0x9b,0x9f,0xa1,0xd0,0xa9,0x9b,0xd0,0xda,0xcd,0xef,0x4e,0xd0};
    static std::uint8_t b76[32] = {0x8f,0x97,0x86,0xac,0xca,0x90,0x8b,0xa6,0x4b,0x9b,0xe7,0x16,0xc1,0xe1,0x86,0xe8,0x6e,0x98,0x04,0x4e,0xe5,0x9a,0x58,0x4b,0x40,0x32,0x87,0x94,0xeb,0xee,0x15,0x74};
    static std::uint8_t c76[32] = {0x55,0x79,0x4d,0xbe,0xd7,0xce,0xdd,0x57,0x6f,0x94,0xbe,0x2f,0x12,0xe5,0xfa,0x59,0x48,0xdd,0xe3,0x25,0xce,0xef,0xd5,0x74,0x4e,0xd8,0x2a,0xe2,0xb8,0xa0,0x08,0x81};
    sm9_fn_from_bytes(a, a76);
    sm9_fn_from_bytes(b, b76);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c76, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a77[32] = {0x42,0x07,0xa2,0xad,0x8f,0x0b,0x35,0x82,0xca,0xcd,0x0d,0xc2,0x6e,0x44,0x5f,0xe2,0x32,0x2a,0x5d,0x2a,0x70,0x4c,0x5c,0x14,0x20,0x24,0x63,0xfb,0xc6,0xfa,0x4f,0xd1};
    static std::uint8_t b77[32] = {0x7e,0xfb,0xb4,0xca,0xc5,0x46,0xc8,0x0e,0xb6,0x58,0xa6,0x25,0x4a,0x3c,0x96,0x30,0x5a,0xd9,0xd4,0x61,0xa7,0x00,0x2a,0x13,0x42,0xa8,0x2f,0xec,0x9d,0xee,0xeb,0x49};
    static std::uint8_t c77[32] = {0x79,0x4b,0xed,0xe2,0xcc,0x68,0x14,0x65,0xea,0x78,0x12,0xed,0x19,0x96,0x90,0xf6,0x21,0x43,0x1c,0x13,0xe2,0x36,0xbd,0xef,0xc2,0xeb,0x15,0xab,0xff,0xaa,0x33,0xad};
    sm9_fn_from_bytes(a, a77);
    sm9_fn_from_bytes(b, b77);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c77, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a78[32] = {0x46,0xdf,0x94,0xb3,0xfd,0xaf,0x2f,0x03,0xf5,0x41,0x98,0x6e,0xd5,0x86,0xe1,0xa6,0xe6,0xd4,0x1c,0x82,0x5d,0xe6,0xf4,0x7d,0xd7,0xcd,0x50,0x13,0x8f,0xa1,0xd4,0xf4};
    static std::uint8_t b78[32] = {0x54,0x3c,0xb6,0x8f,0x6b,0x0a,0x3e,0x1d,0xbc,0x1c,0x07,0xff,0xcf,0xa0,0x3d,0x79,0x62,0x20,0xd2,0xe9,0x36,0xa1,0xf5,0x59,0xbf,0x8a,0x48,0x55,0x5a,0x74,0xe4,0x54};
    static std::uint8_t c78[32] = {0xa8,0xe2,0xde,0x24,0x95,0x48,0x97,0xd8,0x0f,0x29,0x3b,0xbe,0xfb,0x75,0x6b,0x71,0xce,0xa5,0xdc,0xe4,0x40,0x2f,0x8b,0x12,0xfd,0xb1,0xe9,0x5b,0x0b,0xcb,0xbf,0xc5};
    sm9_fn_from_bytes(a, a78);
    sm9_fn_from_bytes(b, b78);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c78, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a79[32] = {0x08,0x03,0x4e,0x58,0x1f,0xd4,0x1f,0x27,0xf7,0xe3,0x40,0xd6,0xc2,0x43,0x85,0x42,0xcc,0x8f,0xef,0xe5,0xb9,0x54,0x49,0x93,0x3f,0xd5,0x12,0xb7,0xe8,0x26,0x83,0x17};
    static std::uint8_t b79[32] = {0x0f,0xa9,0x43,0xc5,0xe5,0x98,0x28,0xa4,0xad,0x6e,0x2d,0x64,0xbd,0xf0,0xaa,0x13,0xe0,0xfa,0xe8,0x55,0xe4,0xc1,0x49,0xa9,0x94,0x91,0xc5,0xdb,0x83,0x50,0x6a,0xe0};
    static std::uint8_t c79[32] = {0xae,0x9a,0x0a,0x92,0x3c,0xdf,0x9d,0x75,0x20,0x78,0xbe,0xc1,0xf9,0xe1,0xa2,0x73,0x35,0x87,0x9a,0xda,0xed,0x7d,0x8b,0xd8,0x90,0xb2,0x2e,0x79,0x3b,0x74,0xe7,0x5c};
    sm9_fn_from_bytes(a, a79);
    sm9_fn_from_bytes(b, b79);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c79, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a80[32] = {0x75,0x58,0x26,0x7a,0x05,0xd1,0x33,0xce,0xf2,0x16,0x42,0x58,0x37,0x44,0xe6,0x28,0xf9,0x79,0x60,0x35,0x58,0x3c,0x1c,0x1d,0x76,0x03,0x34,0x7c,0x20,0x20,0x80,0x6c};
    static std::uint8_t b80[32] = {0x45,0x3e,0x62,0x9a,0x29,0xe2,0x0d,0xec,0x07,0x1a,0x90,0x50,0x51,0xa0,0x43,0x1f,0x09,0x39,0xf5,0xb7,0x75,0x5b,0x12,0x61,0x10,0x47,0xf4,0x35,0xc9,0xf7,0x0e,0x80};
    static std::uint8_t c80[32] = {0x30,0x19,0xc3,0xdf,0xdb,0xef,0x25,0xe2,0xea,0xfb,0xb2,0x07,0xe5,0xa4,0xa3,0x09,0xf0,0x3f,0x6a,0x7d,0xe2,0xe1,0x09,0xbc,0x65,0xbb,0x40,0x46,0x56,0x29,0x71,0xec};
    sm9_fn_from_bytes(a, a80);
    sm9_fn_from_bytes(b, b80);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c80, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a81[32] = {0x63,0x56,0x86,0x73,0x99,0x96,0xe5,0xed,0xc6,0x80,0x92,0x5e,0xe9,0xe6,0xf9,0x5a,0xaf,0xf8,0x44,0x46,0xa5,0xca,0x6c,0x75,0x9c,0x71,0x3c,0x8b,0x85,0x95,0x06,0x77};
    static std::uint8_t b81[32] = {0xae,0xd2,0xfa,0xa1,0xa8,0xef,0x05,0x39,0x18,0x1a,0x72,0x71,0x50,0x30,0xff,0xfa,0x27,0xbd,0xb4,0x52,0x20,0x77,0xbb,0x1e,0xf2,0x0c,0x2c,0xc5,0x6f,0xaf,0xee,0x4f};
    static std::uint8_t c81[32] = {0x6a,0xc3,0x8b,0xd1,0xf3,0x4b,0x87,0xa6,0x84,0x69,0xcb,0x3d,0x8f,0x44,0xc0,0xa4,0xd2,0x2d,0x23,0x3f,0x9e,0x3d,0x3d,0x45,0x8f,0xd3,0xf1,0x62,0xec,0x83,0xe7,0x4d};
    sm9_fn_from_bytes(a, a81);
    sm9_fn_from_bytes(b, b81);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c81, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a82[32] = {0x79,0xab,0xb7,0xca,0xca,0x5a,0xe7,0xb2,0x5c,0xa4,0xed,0x40,0xcb,0x75,0xfc,0x0e,0x3d,0x45,0xa9,0x29,0x24,0x1e,0xa4,0x5b,0xda,0x04,0xf1,0x79,0x3d,0xc0,0x2a,0x41};
    static std::uint8_t b82[32] = {0x5a,0x59,0x7e,0x0c,0xdd,0x87,0x45,0x30,0xf8,0x21,0xda,0x18,0xcc,0xa9,0x87,0x1c,0xc5,0x80,0x4e,0x8b,0x27,0x34,0xd2,0x06,0x82,0x50,0x6a,0xd8,0xbe,0x5a,0x4a,0x79};
    static std::uint8_t c82[32] = {0x1f,0x52,0x39,0xbd,0xec,0xd3,0xa2,0x81,0x64,0x83,0x13,0x27,0xfe,0xcc,0x74,0xf1,0x77,0xc5,0x5a,0x9d,0xfc,0xe9,0xd2,0x55,0x57,0xb4,0x86,0xa0,0x7f,0x65,0xdf,0xc8};
    sm9_fn_from_bytes(a, a82);
    sm9_fn_from_bytes(b, b82);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c82, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a83[32] = {0x24,0x2a,0x59,0xb6,0x65,0x0e,0xf5,0x0a,0x72,0x78,0x5b,0x61,0xae,0x56,0xd8,0xb8,0xb7,0xcf,0x03,0x29,0xf3,0xf6,0x75,0xad,0x90,0x73,0x25,0x40,0x6d,0xb1,0x6b,0xca};
    static std::uint8_t b83[32] = {0x64,0x5a,0x08,0x7b,0x6b,0xbc,0x71,0x56,0x15,0xf2,0x19,0xa3,0x2f,0x18,0x9e,0xfe,0xf3,0xbf,0x2a,0x72,0x08,0x2f,0x82,0x43,0xc2,0xf5,0xd1,0xee,0x37,0xba,0xe8,0xad};
    static std::uint8_t c83[32] = {0x76,0x10,0x51,0x3a,0xfb,0xf6,0x2a,0xa6,0x32,0x89,0xed,0x0e,0x74,0xcd,0x00,0xfe,0x0e,0x02,0x6c,0x03,0x04,0xb1,0x7f,0x58,0xb2,0xec,0x34,0xef,0x0c,0x95,0x52,0x42};
    sm9_fn_from_bytes(a, a83);
    sm9_fn_from_bytes(b, b83);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c83, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a84[32] = {0x07,0x48,0x47,0xa0,0x1f,0xef,0x60,0x04,0x4a,0x30,0xb5,0xf5,0x31,0x58,0x1d,0x1b,0x54,0x9e,0x26,0x85,0xd4,0xea,0xe1,0x37,0x7e,0x57,0x16,0x35,0x3a,0xd9,0x35,0x58};
    static std::uint8_t b84[32] = {0x84,0x6b,0x7d,0xd2,0x50,0x1d,0x6c,0xb2,0xa9,0x30,0xa9,0x6f,0x5c,0xaa,0x4b,0xef,0xa1,0x66,0x90,0x4d,0xba,0xf9,0x2f,0x30,0x70,0x15,0xe7,0x80,0x80,0x43,0xcc,0xa5};
    static std::uint8_t c84[32] = {0x39,0x1c,0xc9,0xcd,0xd2,0x75,0x9a,0x43,0x77,0x03,0xb7,0xd5,0xca,0x3c,0x98,0x6f,0xfd,0x2a,0x29,0x83,0x32,0xdc,0x3d,0xf5,0xf3,0xb0,0x10,0x51,0x91,0x34,0x37,0xd8};
    sm9_fn_from_bytes(a, a84);
    sm9_fn_from_bytes(b, b84);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c84, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a85[32] = {0x22,0x69,0x50,0x2c,0xec,0xdf,0xf8,0x16,0x5f,0xbf,0x74,0x83,0x75,0x22,0x93,0x2b,0x53,0x68,0x51,0x1c,0xf3,0xfe,0xb6,0x21,0x79,0xd3,0xd6,0x20,0x43,0x22,0x47,0x47};
    static std::uint8_t b85[32] = {0x8b,0x7a,0xd8,0x6b,0xfc,0x50,0x16,0xbb,0xfd,0x17,0x63,0x0f,0xcd,0xf9,0x07,0xaa,0x8d,0x11,0x61,0xab,0xd1,0xd7,0x88,0xc0,0x56,0x83,0x2f,0x45,0x58,0xe8,0x9e,0xab};
    static std::uint8_t c85[32] = {0x4d,0x2e,0x77,0xc0,0xf3,0x33,0x88,0x4c,0x38,0xab,0xbc,0xc3,0x9c,0xb8,0x52,0xc5,0x10,0x49,0x82,0xbc,0x3b,0x11,0xb9,0x50,0x08,0xbf,0x88,0x77,0xc0,0xd8,0x77,0xc1};
    sm9_fn_from_bytes(a, a85);
    sm9_fn_from_bytes(b, b85);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c85, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a86[32] = {0x1b,0xbc,0xd6,0x13,0x0f,0x47,0xb7,0xac,0x45,0xcc,0xab,0xce,0xc6,0x1b,0xd7,0xbe,0xa6,0x09,0x34,0xd1,0x5b,0xc1,0xb2,0xbd,0xfc,0x4d,0xea,0x86,0xf1,0xcd,0xfc,0x11};
    static std::uint8_t b86[32] = {0x14,0x04,0x83,0x93,0xc1,0x95,0x56,0xd5,0x0d,0x99,0xf4,0x42,0xfc,0x61,0xed,0x47,0x35,0x7c,0xfe,0x76,0xb5,0xcd,0x54,0xf5,0x25,0xa8,0xac,0xae,0x4e,0x5c,0x2b,0xe2};
    static std::uint8_t c86[32] = {0x07,0xb8,0x52,0x7f,0x4d,0xb2,0x60,0xd7,0x38,0x32,0xb7,0x8b,0xc9,0xb9,0xea,0x77,0x70,0x8c,0x36,0x5a,0xa5,0xf4,0x5d,0xc8,0xd6,0xa5,0x3d,0xd8,0xa3,0x71,0xd0,0x2f};
    sm9_fn_from_bytes(a, a86);
    sm9_fn_from_bytes(b, b86);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c86, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a87[32] = {0x15,0xb8,0x2d,0x5c,0xe6,0xfc,0x13,0xda,0x33,0x5e,0x26,0x8a,0x6f,0x52,0x37,0x35,0x18,0xe3,0x22,0x5e,0xe9,0x7e,0x23,0xce,0xfa,0xd9,0x0c,0xc6,0xa4,0x37,0xe6,0x79};
    static std::uint8_t b87[32] = {0x2e,0xe3,0x0a,0x95,0x6c,0x3d,0xf9,0xf8,0x54,0xd0,0xe2,0x42,0xd3,0xf0,0xe4,0x48,0x55,0xd3,0xfd,0x6f,0xca,0x52,0x5e,0xb0,0x03,0xb2,0x89,0xda,0x5e,0x74,0xc2,0x4e};
    static std::uint8_t c87[32] = {0x9d,0x15,0x22,0xc7,0x7d,0x61,0xc0,0xd3,0xb4,0x90,0xef,0x97,0x90,0xf0,0x1a,0x31,0x0d,0x01,0xb8,0x3a,0x38,0x16,0x51,0x0d,0xdc,0x95,0x64,0x89,0x1c,0x61,0xf3,0x50};
    sm9_fn_from_bytes(a, a87);
    sm9_fn_from_bytes(b, b87);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c87, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a88[32] = {0x7b,0x86,0xae,0x65,0x26,0x1a,0xda,0x64,0xf1,0x7b,0x35,0x8b,0x58,0xd7,0x17,0x25,0x14,0xfb,0xe5,0xa2,0x03,0xca,0x61,0xb8,0xe9,0x4f,0xb6,0x05,0xa5,0x7a,0xbd,0xdd};
    static std::uint8_t b88[32] = {0xb2,0xdb,0xfc,0x85,0x10,0xf1,0xaf,0xcb,0x94,0xf9,0x73,0xdd,0x1f,0xb3,0xf6,0xf3,0xcf,0xb5,0xc3,0x23,0xae,0xea,0x6f,0xf3,0x9e,0x8c,0x7a,0x0f,0x74,0xa1,0x0a,0x46};
    static std::uint8_t c88[32] = {0x7e,0xea,0xb1,0xe0,0x17,0xcc,0xd1,0x8b,0x32,0x85,0x6c,0xfe,0x2e,0xb1,0xe7,0x75,0x8f,0x38,0xb5,0xc9,0x6d,0xca,0x7d,0xb4,0x30,0x32,0x1d,0x93,0x07,0x78,0x82,0xbc};
    sm9_fn_from_bytes(a, a88);
    sm9_fn_from_bytes(b, b88);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c88, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a89[32] = {0x39,0xbc,0x69,0xca,0x58,0x4e,0x2f,0x1b,0xc7,0x31,0x2a,0xdc,0x3c,0xde,0x01,0x1a,0x19,0xa7,0xd1,0x02,0xda,0xae,0xd6,0x40,0x92,0x17,0x74,0xb9,0x0d,0x1e,0x63,0xd6};
    static std::uint8_t b89[32] = {0x68,0xa0,0xd9,0x45,0xf5,0x29,0xb5,0x32,0x7b,0x50,0x3e,0xd5,0x9b,0xd7,0x58,0xc4,0x97,0x18,0xc1,0xde,0x4b,0xdf,0x12,0xfa,0xbc,0x26,0xbc,0x1c,0xf5,0x8b,0x9a,0x19};
    static std::uint8_t c89[32] = {0x87,0x5b,0x90,0x84,0x65,0xc8,0x20,0xdb,0x21,0xe4,0x97,0x56,0x96,0x95,0x6f,0x99,0xcc,0x81,0xa2,0x6f,0xa7,0xba,0x4f,0x34,0xbb,0x5f,0x9a,0x38,0xee,0x31,0x98,0xe2};
    sm9_fn_from_bytes(a, a89);
    sm9_fn_from_bytes(b, b89);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c89, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a90[32] = {0x02,0x57,0xb2,0x0b,0x45,0xfb,0xff,0x86,0xbb,0x5c,0x96,0x6b,0x50,0xf4,0x42,0x95,0x30,0x0e,0x41,0xad,0x67,0x81,0x4b,0x25,0x58,0x1f,0xd4,0xf0,0x64,0x18,0x60,0x23};
    static std::uint8_t b90[32] = {0x45,0x20,0xd7,0xed,0xaa,0x90,0x62,0xff,0x7c,0x14,0x45,0x4a,0x4c,0x8c,0x8a,0x54,0x5a,0x58,0x4f,0x47,0x7c,0x39,0x7d,0xd6,0xec,0xc5,0x7f,0xa5,0xa2,0x06,0xba,0xb4};
    static std::uint8_t c90[32] = {0x73,0x76,0xda,0x1d,0x9e,0x0f,0x43,0x79,0x15,0x4b,0xfc,0x70,0xf9,0xf6,0x7f,0x85,0x1f,0xa8,0x85,0xb1,0x04,0x32,0x59,0x3d,0x50,0xc9,0x36,0xe7,0x98,0xb0,0x74,0x94};
    sm9_fn_from_bytes(a, a90);
    sm9_fn_from_bytes(b, b90);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c90, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a91[32] = {0x23,0x52,0xb7,0x7f,0xae,0x6a,0xef,0x3e,0xe4,0xd9,0xb8,0xf3,0xc9,0xc9,0x3c,0x0c,0xa6,0x4f,0x4b,0x09,0x1f,0xd1,0xf1,0x31,0x9b,0xe0,0x83,0x3d,0x17,0x75,0xd7,0x78};
    static std::uint8_t b91[32] = {0x3c,0xc5,0xd4,0x42,0x40,0x59,0xd6,0xe7,0x84,0x59,0x7a,0x00,0x56,0x5b,0x69,0xae,0xee,0xa0,0x84,0x00,0x06,0x77,0x44,0x47,0xb3,0x3f,0xc4,0xb5,0xea,0x59,0xe2,0x5f};
    static std::uint8_t c91[32] = {0x9c,0xcc,0xe3,0x3d,0x70,0xb4,0xbf,0x49,0x36,0x83,0xea,0x43,0x68,0xfc,0x99,0xa2,0x01,0xa1,0x5a,0x54,0x32,0x45,0x38,0xd8,0xce,0x0f,0xa0,0x24,0x03,0xba,0xc4,0x3e};
    sm9_fn_from_bytes(a, a91);
    sm9_fn_from_bytes(b, b91);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c91, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a92[32] = {0x1d,0xc2,0x2b,0x21,0x74,0xa9,0x30,0x4d,0x92,0xfb,0xbb,0x3b,0x8c,0x39,0x1a,0x60,0xd2,0x5c,0x5f,0x17,0xf0,0xf8,0x61,0x0a,0x67,0xfd,0x4a,0xd0,0xe8,0x07,0x69,0xc4};
    static std::uint8_t b92[32] = {0x94,0xf3,0x57,0x71,0x9a,0x1c,0x3e,0x0c,0xd8,0xb0,0x5f,0x6b,0x04,0x24,0x17,0x0e,0xaf,0x7c,0x36,0x33,0x9c,0x1e,0xc3,0x62,0x2e,0xa4,0xf8,0x08,0xce,0x55,0xeb,0x09};
    static std::uint8_t c92[32] = {0x3f,0x0e,0xd3,0xaf,0xdd,0x30,0x99,0x32,0x90,0x4f,0x07,0x20,0x7d,0xa3,0xca,0x96,0x6c,0xd2,0xbc,0x2f,0x6d,0xc4,0x29,0x97,0x1e,0xc7,0x34,0x64,0xf0,0x50,0x4d,0xe0};
    sm9_fn_from_bytes(a, a92);
    sm9_fn_from_bytes(b, b92);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c92, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a93[32] = {0x32,0x55,0xcf,0xf5,0xd5,0x0a,0x5e,0xd6,0x18,0x2f,0x10,0xd4,0xf0,0xad,0x48,0x70,0x3d,0x22,0xdc,0x45,0x91,0x43,0xcb,0x9b,0x0c,0x34,0xf0,0x58,0x2a,0x2e,0x80,0xc6};
    static std::uint8_t b93[32] = {0xa2,0x86,0xcd,0x92,0x1a,0x8e,0xff,0x1b,0xe3,0xf7,0x00,0x7b,0xf9,0x0f,0x90,0xa7,0xd0,0x33,0xab,0x07,0xa1,0xf7,0x50,0xe8,0x62,0x0a,0x2f,0x98,0x05,0x8f,0xb5,0x15};
    static std::uint8_t c93[32] = {0x46,0x0f,0x02,0x63,0xbd,0x1f,0x06,0xac,0x0a,0x3b,0xbb,0xa8,0xed,0x2c,0x7f,0x0c,0xb6,0xe1,0xc4,0x89,0x08,0x37,0x06,0xa1,0x8f,0x99,0xa2,0x5c,0xfb,0x3d,0x9a,0xd6};
    sm9_fn_from_bytes(a, a93);
    sm9_fn_from_bytes(b, b93);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c93, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a94[32] = {0x56,0xc9,0xb1,0x6b,0xf1,0x71,0x95,0xa0,0xf3,0xb0,0x25,0x46,0x7f,0x17,0x23,0x0e,0x20,0x2d,0xfa,0x71,0x09,0x8c,0xb0,0x3e,0xe6,0x86,0xa0,0xd2,0x54,0x13,0x44,0xc9};
    static std::uint8_t b94[32] = {0xa7,0x42,0x16,0x92,0xf8,0x66,0x1b,0xea,0x30,0x53,0x55,0x7f,0x55,0x0b,0xb5,0x43,0x69,0xce,0xf1,0xc9,0xa2,0xb9,0xad,0xf7,0xe5,0xea,0xbb,0xa6,0xa8,0xdb,0x3d,0x96};
    static std::uint8_t c94[32] = {0x65,0xc7,0x9a,0xd8,0xfb,0xaf,0x20,0xa8,0x99,0x60,0x7b,0x17,0x1f,0x9a,0x35,0x0f,0x00,0x51,0x9b,0xf2,0x7f,0xbd,0x8e,0x35,0xe6,0x0a,0xc6,0xc8,0x81,0xd6,0xd6,0x58};
    sm9_fn_from_bytes(a, a94);
    sm9_fn_from_bytes(b, b94);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c94, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a95[32] = {0x29,0x1b,0x58,0x9f,0x4a,0x4a,0x3b,0xde,0x53,0xff,0xc2,0xba,0x3a,0xe9,0x9c,0xab,0xf2,0xed,0x00,0xd9,0x01,0x9a,0x09,0xbf,0x68,0xcf,0x85,0x6d,0x43,0x1a,0x3a,0x9c};
    static std::uint8_t b95[32] = {0x15,0xa7,0x10,0xba,0x1d,0xa1,0x51,0x37,0x02,0xac,0x3b,0xe3,0xb4,0x4b,0x6f,0xb0,0xc8,0x32,0x9d,0xe5,0x05,0x1f,0x4f,0xda,0xd6,0x9c,0x94,0xe9,0xb7,0x55,0xdd,0x18};
    static std::uint8_t c95[32] = {0x13,0x74,0x47,0xe5,0x2c,0xa8,0xea,0xa7,0x51,0x53,0x86,0xd6,0x86,0x9e,0x2c,0xfb,0x2a,0xba,0x62,0xf3,0xfc,0x7a,0xb9,0xe4,0x92,0x32,0xf0,0x83,0x8b,0xc4,0x5d,0x84};
    sm9_fn_from_bytes(a, a95);
    sm9_fn_from_bytes(b, b95);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c95, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a96[32] = {0x2e,0xf3,0xf0,0x44,0xa7,0x67,0xf9,0x9e,0x69,0x59,0xb5,0xd3,0x07,0xf2,0x19,0x22,0x04,0x4a,0x9f,0xb7,0x5d,0xfe,0x84,0xd2,0x8e,0x71,0x56,0x0a,0x71,0x6d,0xe1,0x2c};
    static std::uint8_t b96[32] = {0x0d,0x4a,0xf9,0xd1,0x41,0x5f,0xa7,0xf5,0x8c,0xc6,0x6d,0x83,0x6f,0x43,0x6b,0xea,0xf0,0xb5,0xd6,0x84,0x69,0x52,0x86,0x9b,0x53,0x1d,0x28,0xfc,0x70,0x0b,0xd1,0xba};
    static std::uint8_t c96[32] = {0x21,0xa8,0xf6,0x73,0x66,0x08,0x51,0xa8,0xdc,0x93,0x48,0x4f,0x98,0xae,0xad,0x37,0x13,0x94,0xc9,0x32,0xf4,0xab,0xfe,0x37,0x3b,0x54,0x2d,0x0e,0x01,0x62,0x0f,0x72};
    sm9_fn_from_bytes(a, a96);
    sm9_fn_from_bytes(b, b96);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c96, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a97[32] = {0x57,0x4f,0x79,0x61,0x5a,0x89,0xfe,0x6f,0x0a,0x16,0x3d,0x63,0x33,0x55,0x37,0xac,0x49,0xb5,0xde,0x02,0xbe,0x41,0x7e,0x5a,0x9e,0x80,0x18,0xe3,0xe8,0x8b,0xdd,0xe3};
    static std::uint8_t b97[32] = {0x11,0x04,0x29,0x61,0xef,0x87,0xfb,0xe1,0x4b,0x3c,0x83,0x29,0x3c,0x05,0x27,0x2c,0x1e,0x48,0x52,0xea,0xab,0x4f,0xe0,0x50,0x48,0x4e,0x02,0x4e,0x93,0x50,0x7e,0xdf};
    static std::uint8_t c97[32] = {0x46,0x4b,0x4f,0xff,0x6b,0x02,0x02,0x8d,0xbe,0xd9,0xba,0x39,0xf7,0x50,0x10,0x80,0x2b,0x6d,0x8b,0x18,0x12,0xf1,0x9e,0x0a,0x56,0x32,0x16,0x95,0x55,0x3b,0x5f,0x04};
    sm9_fn_from_bytes(a, a97);
    sm9_fn_from_bytes(b, b97);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c97, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a98[32] = {0x63,0x94,0x33,0xdc,0x79,0x36,0x13,0x2a,0x87,0x00,0x58,0x41,0xfc,0x0d,0xd7,0x00,0x6f,0x26,0xf1,0x84,0x98,0xf4,0x4e,0x4b,0x36,0xe5,0xe8,0xd8,0xee,0xcb,0x5c,0x47};
    static std::uint8_t b98[32] = {0x48,0xf1,0x91,0x60,0xd9,0x7f,0xfb,0x55,0xd3,0x56,0x53,0xca,0xde,0xa9,0x48,0x27,0x3e,0x38,0xfe,0x40,0x5a,0xa4,0xaf,0x91,0xa0,0xc6,0x8e,0xe3,0xbb,0x42,0x3e,0x84};
    static std::uint8_t c98[32] = {0x1a,0xa2,0xa2,0x7b,0x9f,0xb6,0x17,0xd4,0xb3,0xaa,0x04,0x77,0x1d,0x64,0x8e,0xd9,0x30,0xed,0xf3,0x44,0x3e,0x4f,0x9e,0xb9,0x96,0x1f,0x59,0xf5,0x33,0x89,0x1d,0xc3};
    sm9_fn_from_bytes(a, a98);
    sm9_fn_from_bytes(b, b98);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c98, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
    static std::uint8_t a99[32] = {0x05,0x63,0x32,0xe4,0xb8,0x10,0xf1,0xa5,0x8e,0x3b,0xd2,0x1d,0x04,0x13,0x34,0x1a,0xf0,0x81,0x1f,0xd0,0x94,0xf7,0x79,0x9b,0xe3,0x85,0x8f,0xcf,0x50,0x54,0x32,0xce};
    static std::uint8_t b99[32] = {0x9e,0x9b,0x27,0x7e,0xe8,0x7f,0x6c,0x98,0x73,0x48,0xe4,0x4c,0x8e,0xca,0xc4,0xcf,0xf1,0x57,0x7c,0x47,0x30,0x91,0x26,0x16,0x96,0xa9,0x8e,0xfc,0x09,0xff,0xef,0xf2};
    static std::uint8_t c99[32] = {0x1d,0x08,0x0b,0x65,0xd2,0x35,0x2b,0xfe,0xf0,0xf6,0x99,0x20,0x6a,0xd7,0x36,0x8f,0x49,0x1c,0x36,0xd4,0x7d,0x50,0xdf,0x74,0x32,0x4a,0xe2,0x70,0x1c,0xf3,0x12,0x01};
    sm9_fn_from_bytes(a, a99);
    sm9_fn_from_bytes(b, b99);
    sm9_fn_sub(c, a, b);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c99, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sub");
    }
}